The difference between POS and Ansipos functions in Delphi

Source: Internet
Author: User
Tags abs


The main difference between POS and Ansipos is that the POS parameter is used more than one character, while Ansipos is used more than one character:

For example: I:=pos (' A ', ' Sssssas ');

I:=ansipos (' abc ', ' Sdabcss ');


Ansipos is an ANSI character as a POS unit, such as Ansipos (' | ', ' Wang Apoz | ') The resulting value is 5.
POS is in bytes as POS units, such as POS (' | ', ' Wang Apoz | ') The resulting value is 4, because "' Apoz" is made up of two bytes, and its low is "|" So the result after POS is 4


In addition Ansipos and POS can be POS multi-character targets, for example:
Ansipos (' Abs ', ' 123abs78 ') = 4
Ansipos (' Abs ', ' 123a5678 ') = 0
Pos (' Abs ', ' 123abs78 ') = 4
Pos (' Abs ', ' 123a5678 ') = 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.