Delphi programming-Character Processing

Source: Internet
Author: User

Positioning
Function ansilastchar (const S: string): pchar; returns the last character of the ANSI string, supporting multi-byte characters
Function ansistrlastchar (P: pchar): pchar; returns the last character (not including null) of an ANSI string ending with an empty string. Among the multi-byte characters, it may not be equal to the last byte
Function bytetocharindex (const S: string; index: integer): integer; returns the character location containing the specified byte of the index.
Function chartobyteindex (const S: string; index: integer): integer; returns the byte location of the specified character in index.
Function nextcharindex (const S: string; index: integer): integer; returns the starting byte location of the next character specified by index.
Function strnextchar (const STR: pchar): pchar; returns the next character of the specified string

Count
Function bytetocharlen (const S: string; maxlen: integer): integer; returns the number of characters that contain the specified number of maxlen bytes.
Function charlength (const S: string; index: integer): integer; returns the byte length of the string.
Function chartobytelen (const S: string; maxlen: integer): integer; returns the byte length of the string specified by maxlen.
Function strcharlength (const STR: pchar): integer; returns the length of the first character in the string.

Conversion
Function ansilowercasefilename (const S: string): string; converts an ANSI string to lowercase
Function ansiuppercasefilename (const S: string): string; converts an ANSI string to uppercase.

Judgment
Function ansicomparefilename (const S1, S2: string): integer; compares the names of two ANSI characters, which are case insensitive.
Function bytetype (const S: string; index: integer): tmbcsbytetype; returns whether the specified byte of the index is a single byte or the first or second byte of the double byte.
Function samefilename (const S1, S2: string): Boolean; judge whether the file name is the same
Function strbytetype (STR: pchar; index: Cardinal): tmbcsbytetype; determines whether the specified index byte is a single byte or the first or second byte

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.