Functions related to strings in Delphi

xiaoxiao2021-03-06  72

AnsiCompareStr function comparison string (case sensitive)

AnsicompareText function comparison string (not case sensitive)

AnsilowerCase function converts characters to lowercase

The ANSIUPPERCASE function converts characters to uppercase

DateTimetOfileDate function Convert Delphi's date format to DOS date format

The DateTimetostr function converts the date time format to a string

DateTimetString function converts the date time format to a string

The DateTostr function converts the date format to a string

The FLOATTOSTRF function converts floating point numbers to strings

The FLOATTOSTR function converts floating point numbers to strings

INSERT Insert a subtrunch in a string

The STR function converts the numerical value to a string

The stralloc function assigns the maximum length -1 buffer to the string ended with NULL

The strbufsize function returns the maximum number of characters stored in the character buffer allocated by Stralloc

The STRCAT function attached a string to another string and returned the merged string

Strcomp function compares two strings

The stropy function copies a string to another string

The strdispose function releases strings on the stack

The strecopy function copies a string to another string and returns the pointer of the result string tail.

Strend function returns a pointer to the tail of the string

STRETCH Attributes Automatically Adjusts the Size Strfmt Function of Controls Formatting a Series of Parameters

StriComp function compares two strings (not case sensitive)

The StringTowideChar function converts the ANSI string to a Unicode string

The strlcat function attached the characters in a string to another string and returned the merged string

The strlcomp function compares two strings with maximum length

The strlcopy function copies the characters in a string to another string

Strlen function returns the number of characters in the string

Strlfmt function format a series of parameters, which contain pointers to target buffers.

The strlicomp function compares two strings with maximum length (not case sensitive)

The strlower function converts the characters in the string to lowercase

The strMove function copies the characters in a string to another string.

The STRNEW function allocates a string on the stack

The STRPAS function will convert the string of the string ended with NULL to the string of the Pascal class.

The strpcopy function copies the string of the Pascal class to the string ended with NULL

The STRPLCOPY function is copied from the maximum length string of the Pascal class to the end of NULL.

The STRPOS function returns a string in another string first appearance pointer

STRSCAN function returns a pointer to the last character in the string

STRSCAN function returns a first-character pointer in the string

The Strtodate function converts the string into the date format STRTODATETIME function to convert a string into a date / time format

The StrtOfloat function converts a given string to floating point numbers

The StrtoinT function converts the string to integer

The StrtointDef function converts strings to integer or default values.

The Strtotime function converts the string into time format

The STRUPPER function converts the characters in the string to uppercase

[String function is full]

The first Function AnsireSembleStext (const at youxt, aother: string): boolean;

$ [Strutils.pas

Function returns two strings to be similar

Description ANSI (American National Standards Institute) US National Standards Association; not case sensitive

Reference Function Strutils.SoundExProc; Var Strutils.ansiresembleSproc

Example checkbox1.checked: = ANSIRESEMBLESTEXT (Edit1.Text, Edit2.Text);

━━━━━━━━━━━━━━━━━━━

The first Function AnsicontAinstext (const attext, asubtext: String): boolean;

$ [Strutils.pas

Function Return Strings ATEXT contains substrings asubtext

Explain that it is not case sensitive

Reference Function Strutils.ansiuppercase; Function Strutils.ansipos

Example checkbox1.checked: = ansicontainstext (edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function AnsistartStext (const asubtext, attext: string): boolean

$ [Strutils.pas

Function Returns a string ATEXT be started with a child string asubtext

Explain that it is not case sensitive

Reference Function Windows.comPareString

Example Checkbox1.checked: = ansistartstext (edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function AnsiendStext (const asubtext, attext: string): boolean;

$ [Strutils.pas

Function return string ATEXT End of subquarters asubtext

Explain that it is not case sensitive

Reference Function Windows.comPareString

Example checkbox1.checked: = ansiendstext (edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function Ansireplacetext (Const AText, AFROMTEXT, Atotext: String): String; $ [Strutils.Pas

Function Returns ATEXT ATEXT Replace with SubtromText Results

Explain that it is not case sensitive

Reference function sysutils.stringReplace; type sysutils.treplaceflags

Example edit4.text: = ANSIREPLACETEXT (Edit1.Text, Edit2.Text, Edit3.Text);

━━━━━━━━━━━━━━━━━━━

First Function AnsimatchText (Const Atext: String; Const Avalues: array of

String): Boolean; $ [strutils.pas

Function Returns the string array Avalues ​​contains a string ATEXT

Explain that it is not case sensitive

Reference Function Strutils.ansiIndexText

Example checkbox1.checked: = ANSIMATCHTEXT (Edit1.Text, ['A1', 'A2', 'A3',

'A4']);

━━━━━━━━━━━━━━━━━━━

The head of Function AnsiIndexText (Const Ate: String; Const Avalues: array of

String): Integer; $ [strutils.pas

Function Returns the location of the string ATEXT in the string array avateues

Explanation is not case sensitive; if it is not included, return -1

Reference Function Sysutils.ansisametext

Example spinedit1.value: = ANSIINDEXTEXT (Edit1.Text, ['A1', 'A2', 'A3', 'A4']);

━━━━━━━━━━━━━━━━━━━

The first Function AnsicontAinsStr (Const AText: String): Boolean;

$ [Strutils.pas

Function Return Strings ATEXT contains substrings asubtext

Explanation of case sensitive

Reference Function Strutils.ansipos

Example Checkbox1.checked: = ansicontainsstr (edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function AnsistStr (const asubtext, at: string): boolean;

$ [Strutils.pas

Function Returns a string ATEXT be started with a child string asubtext

Explanation of case sensitive

Reference Function Sysutils.ansisameStr

Example CheckBox1.checked: = ansistartsstr (edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

Head Function Ansiendsstr (const asubtext, at: string): boolean

$ [Strutils.pas

Function return string ATEXT End of subquarters asubtext

Explanation of case sensitive

Reference Function Sysutils.ansisameStr

Example checkbox1.checked: = ANSIENDSSTR (Edit1.Text, Edit2.Text);

━━━━━━━━━━━━━━━━━━━

The first Function AnsirePlaceStr (Const AText, AFROMText, Atotext: String): String; $ [Strutils.Pas

Function Returns ATEXT ATEXT Replace with SubtromText Results

Explanation of case sensitive

Reference function sysutils.stringReplace; type sysutils.treplaceflags

Example edit4.text: = ANSIREPLACESTR (Edit1.Text, Edit2.Text, Edit3.Text);

━━━━━━━━━━━━━━━━━━━

Head of Function AnsimatchStr (Const Ate: String; Const Avalues: array of

String): Boolean; $ [strutils.pas

Function Returns the string array Avalues ​​contains a string ATEXT

Explanation of case sensitive

Reference Function Strutils.ansiInDexStr

Example Checkbox1.checked: = ANSIMATCHSTR (Edit1.Text, ['A1', 'A2', 'A3',

'A4']);

━━━━━━━━━━━━━━━━━━━

The head of Function AnsiIndexStr (Const Ate: String; Const Avalues: array of

String): Integer; $ [strutils.pas

Function Returns the location of the string ATEXT in the string array avateues

Explanation of case sensitive

Reference Function Sysutils.ansisameStr

Example spinedit1.value: = ANSIINDEXSTR (Edit1.Text, ['A1', 'A2', 'A3', 'A4']);

━━━━━━━━━━━━━━━━━━━

The headlight dupeString (const: integer): string;

$ [Strutils.pas

Function Returns a string ATEXT ACOUNT copy

Description When ACOUNT is 0, return ''

Reference Function System.setLength

Example edit3.text: = dupeString (Edit1.Text, Spinedit1.Value);

━━━━━━━━━━━━━━━━━━━

The first Function ReverseString (const at: string): String; $ [strutils.pas

Function Returns the reverse order of string ATEXT

Description ReverseString ('1234') = '4321'

Reference Function System.setLength

Example edit3.text: = reverseString (edit1.text);

━━━━━━━━━━━━━━━━━━━

The headlight stuffstring (const at: string; Astart, ALENGTH: Cardinal

Const asubText: string: String; $ [strutils.pas

Function returns a string

Description ASTART: Nested start position; ALENGTH: Nested length; stuffstring ('Abcd', 2, 0, '12') = 'A12BCD'

Reference in function system.copy

Example edit3.text: = stuffstring (edit1.text, spinedit1.value, spinedit2.value, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function Randomfrom (Const Avalues): string; Overload;

$ [Strutils.pas

Function Random Returns an element in the array of strings Avalues

Explain Randomize

Reference Function System.random

Example Randomize; edit3.text: = RandomFrom (['A1', 'A2', 'A3', 'A4']);

━━━━━━━━━━━━━━━━━━━

The first Function ifthen (Avalue: Boolean; Const Atrue: string; Afalse: String =

''): String; OverLoad; $ [strutils.pas

Function Returns the specified logical string

Description ifthen (True, 'is', 'No') = 'is'; ifthen (false, 'is', 'No') = 'No'

Reference

Example edit3.text: = ifthen (checkbox1.checked, edit1.text, edit2.text);

━━━━━━━━━━━━━━━━━━━

The first Function Leftstr (Const ATEXT: STRING; Const Acount: Integer): String;

$ [Strutils.pas

Function Returns the ACOUNT character on the left of the string ATEXT

Description Leftstr ('123456', 3) = '123'

Reference in function system.copy

Example Edit3.Text: = Leftstr (Edit1.Text, Spinedit1.Value);

━━━━━━━━━━━━━━━━━━━

The first Function Rightstr (Const ATEXT: STRING; Const Acount: Integer): String;

$ [Strutils.pas

Function Returns the ACOUNT character on the right side of the string ATEXT

Description RightStr ('123456', 3) = '456'

Reference in function system.copy

Example Edit3.Text: = RightStr (Edit1.Text, Spinedit1.Value);

━━━━━━━━━━━━━━━━━━━

The first Function Midstr (Const ATEXT: STRING; Const Astart, ACOUNT: INTEGER):

String; $ [strutils.pas

Function Returns ATEXT from Astart Account

Explain, it is COPY

Reference in function system.copy

Example edit3.text: = midstr (Edit1.Text, Spinedit1.Value, Spinedit2.Value);

━━━━━━━━━━━━━━━━━━━

The first Function Searchbuf (BUF: PCHAR; BUFLEN: Integer; SELSTART, SELLENGTH:

Integer; searchString: string; options: tstringsearchOptions = [sodown]): PCHAR; $ [strutils.pas

Function Returns the first search pointer position

Description This function is often used in the text search string

Reference

example

/// begin searchbuf

Function Searchedit (EditControl: tcustomed); Const SearchString: String;

SearchOptions: TstringSearchOptions; Findfirst: Boolean = false: boolean;

VAR

Buffer, p: pchar;

Size: Word;

Begin

Result: = FALSE;

IF (length (searchString) = 0).

Size: = EditControl.getTextlen;

IF (size = 0) THEN EXIT;

Buffer: = Stralloc (SIZE 1);

Try

EditControl.getTextBuf (Buffer, Size 1);

P: = Searchbuf (Buffer, Size, Editcontrol.selstart, Editcontrol.sellength,

SearchString, SearchOptions;

IF P <> nil dam

EditControl.selstart: = p - buffer;

EditControl.sellength: = Length (SearchString);

RESULT: = TRUE;

END;

Finally

STRDISPOSE (BUFFER);

END;

END;

procedure TForm1.Button1Click (Sender: TObject); var SearchOptions: TStringSearchOptions; begin SearchOptions: = []; if CheckBox1.Checked then Include (SearchOptions, soDown); if CheckBox2.Checked then Include (SearchOptions, soMatchCase); if CheckBox3.Checked THEN INCLUDE (SearchOptions, SowholeWord); Searchedit (Memo1, Edit1.Text, SearchOptions); Memo1.Setfocus; end; /// end searchbuf ━━━━━━━━━━━━━━━━━━━━━━ ━ The first Function SoundEx (consth: tsoundexlength = 4): String; $ [Strutils.PAS feature Return Probe string Description Depending on the detection method (SOUNDEX) can find a string; http: // www. Nara.gov/genealog reference/coding.html Reference example edit2.text: = SOUNDEX (Edit1.Text, Spinedit1.Value); ━━━━━━━━━━━━━━━━━━━━━ ━ The first Function Soundexint (Const AText: String; Alength: TsoundexintLength = 4): Integer; $ [Strutils.PAS feature Return Detection Integer Description ALENGTH's value, the higher the decoding accuracy, the reference example spinedit2.Value: = Soundexint (Edit1.Text, S Pinedit1.value); ━━━━━━━━ 首 首 首━━━━━━━ 首 首 首 首━━::::: 首; $ [Strutils.PAS feature returns the decoding of the detection integer DecodeOndexint (Soundexint ('Hello')) is equivalent to SoundEx ('Hello') Reference Example Edit2.Text: = Decodesoundexint (Spinedit2.Value); ━━━━━━━━━━━━━━━━━━━ ━━━ The first Function SoundExword (const at: string): Word; $ [strutils.pas feature return detection text value Description No parameter ALENGTH has been fixed to 4 Reference example spinedit2.value: = SoundExword (edit1.text) ━━━━━━━━━━━━━━━━━━━━━ The first Function Decodesoundexword (Avalue: Word): String; $ [Strutils.PAS feature Returns the decoding of the probing text value DecodesoundExword (SoundexWord 'Hello')) is equivalent to SOUNDEX ('

Hello ') Reference EDIT2.TEXT: = DecodesoundExWord (Spinedit2.Value); ━━━━━━━ 首 首 首 首━━━━━━━ 首 首 首 f━━━━━━━ (((((((((((Const AText, AoTher: String; alength: tsoundength = 4): boolean; $ [Strutils.PAS feature returns two string probe strings to indicate Result: = SOUNDEX (AtexT, alength) = Soundex (AOTHER, ALENGTH) Reference example Checkbox1.checked: = SOUNDEXSIMILAR (Edit1.Text, Edit2.Text, Spinedit1.Value); ━━━━━━━) 首 首 首━━━━━━━━ 首 首━━━━━━━━ ((Const AText, AoTher: String; ALENGTH: TsoundExlength = 4): Integer; $ [Strutils.PAS feature Returns the results of comparing two strings to probing strings Result: = ansiCompareStr (Soundex (ATEXT, ALENGTH), SOUNDEX (AOTHER, ALENGTH) Reference Function sysutils.ansiCompareSTR example spinedit2.value: = SoundExCompare (edit1.text, edit2.text, spinedit1.value); ━━━━━━━━ 首 首 首━━━━━━━━━ 首 首━━━━━━━ ((( Const ATEXT, AOTHER: STRING: Boolean; $ [Strutils.PAS function call SoundexSILAR Returns the two string detection strings to indicate the same instructions system variables ANSIRESEMBLESPROC's default reference function strutils.ansiresembleStext example [VAR ANSIRESEMBLESPROC: TCompareTextProc = SoundExProc;] ━━━━━━━ 首 首━━━━━━━━━ 首 首 首━━━━━━━━━ 首 首 f━━━━ (: :━━ 首 首 首━━━━━━━━━ 首 首 首━━━━━━━━━━ 首Pstring; Deprecated; $ [sysutils.pas feature Returns a new string pointer address Description String S Returns NullStr Reference Procedure System.NEW Example Begin Newstr, Disposestr Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT); VAR P: Pstring; begin p: = newstr (edit1.text); edit2.text: = p ^; DisposeStr (P); end; end newstr, DisposeSTR ━━━━━━━━━━━━━━━━━━ ━━━ The first procedure disposeStr (P: pstring); deprecated;

$ [SYSUTILS.PAS feature release string pointer P Resource Description Mix Function Newstr Using Reference Procedure System.Dispose Example ━━━━━━━━━━━━━━━━━━━━━━━━ ━ The first procedure assignstr (var p: pstring; const s: String); DepRecated; $ [sysutils.pas feature to update string S to string pointer P Designing Update Value Reference Function Sysutils. newStr; function SysUtils.DisposeStr examples Begin AssignStr procedure TForm1.Button1Click (Sender: TObject); var P: PString; begin P: = nil; AssignStr (P, Edit1.Text); Edit2.Text: = P ^; DisposeStr (P ); End; end assignstr ━━━━━━━━━ 首 首 首━━━━━━━ 首 首 首━━━━━ 首 首 首 首━━━;; const String; DepRecated; $ [sysutils.pas After the string DEST, add a string S that is equivalent to DEST: = DEST S; Delphi6 is not recommended to use a reference example begin appendstr procedure tform1.button1click (sender: TOBJECT); var s: string; begin s: = Edit2.text; appendstr (s, edit1.text); edit2.text: = s; end; end Appendstr ━━━━━━━━━━━ 首 首 首━━━━━ 首 首 首 首 首 首 首 首 首 首 首 首::: String; $ [Sysutils.PAS feature Return to string S uppercase form Description Non-lowercase Character does not process reference procedure system.setlength example edit2.text: = Uppercase (edit1.text); ━━━━━━━━━ 首 首━━━━━━━━━ 首 首 首━━━━━━ (首 首 首 首 首 首 (((((首 首 首 首: String; $ [sysutils.PAS feature Returns the lowercase of the string S. Description Non-Udress characters do not process reference procedure system.setlength example edit2.text: = lowercase (edit1.text); ━━━━━━━━━━━━ ━━━━━━━━━━ 首 The first Function CompareStr (Const S1, S2: String): Integer; $ [sysutils.pas feature Returns Two characters Description When S1> S2 return value> 0; when S1 S2 return value <0; when S1 = S2 returns value = 0; case sensitive case reference example spinEdit1.Value: =

CompareStr (edit1.text, edit2.text); ━━━━━━━━ 首 首 首━━━━━━━ 首 首 首 f━━━;;;;; Length: Integer: Boolean; Assembler ; $ [Sysutils.PAS feature returns two memory pointer description CompareMem (Pchar ('12A'), PCHAR ('12c'), 2) = true; CompareMem (Pchar ('12a'), PCHAR ('12c') , 3) = false reference example checkbox1.checked: = comparemem (Self, Form1, 8); ━━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━etet━━ 首S1, S2: STRING: Integer; $ [sysutils.pas feature Return Compare two string Description Not Distort Reference Example Spinedit1.Value: = CompareText (Edit1.Text, Edit2.Text); ━━━ ━━━━━━━━ 首━━━━━━━ 首 首 首 首━━━━ 首 首 首 f fetetet: Boolean; $ [SYSUTILS.PAS feature Returns the two strings to wait for the instructions Reference example checkbox1.checked: = Sametext (edit1.text, edit2.text); ━━━━━━━━━ 首 首━━━━━━━━━ 首 首 f━━━━━━━━ (首 首 首━━━━━━━ ((((((━━━━━━━━━ (首 首━━━━━━━━━ (首 首 首━━━━━━━━━━━ 首 首━━━━━━━━━━━ 首 首━━━━━━━━━━━━ 首━━━━━━━━━━━━ 首 首━━━━━━━━━━━ 首 首━━━ : String; $ [sysutils.pas feature Returns the uppercase of the string S. Description ANSI (American National Standards Institute) US National Standard Association; non-lowercase characters unchanged reference Funct ION windows.charupperbuff example edit2.text: = ANSIUPPERCASE (Edit1.Text); ━━━━━━━━━ 首 首━━━━━━━━ 首 首 首━━━━━━━ (首 首;:::::::: String; $ [Sysutils.PAS feature Returns the lowercase of the string S. Description Non-Uda-character does not process reference function windows.charLowerBuff example edit2.text: = ansilowercase (edit1.text); ━━━━━━━━━━━━━━━━ ━━━━━━ 首 首 首 f f f f f (Const S1, S2: String): Integer; $ [SYSUTILS.PAS function Reversible Two string Description When S1> S2 return value> 0; when S1

━━━━━━━━━━━━━━━━━━━ 首 首 首 首 f f 首 f f f f (Const S1, S2: String): Boolean; $ [SYSUTILS.PAS feature Returns the difference between the two strings Size write reference Function Sysutils.ansicomparestr case checkbox1.checked: = AnsisameStr (edit1.text, edit2.text); ━━━━━━━━ 首 首 首━━━━━━━━━━ 首 首 f━━━━ettext S1, S2: STRING: Integer; $ [systemils.pas function reverse compare two string description When S1> S2 return value> 0; when S1 S2 return value> 0; when S1 S2 return value> 0; when S1 S2 return value> 0; when S1

Ansistrol (pchar (edit1.text), pchar (edit2.text), spinedit2.value) ━━━━━━━━━ 首 首 首 首━━━━━━ 首 首 首━━━━━━━━ 首 首 首 首━━━━ ((((((S1, S2: PCHAR Maxlen: cardinal): Integer; $ [sysutils.pas feature Returns Two pointer strings Specify length Description When S1> S2 return value> 0; when S1

$ [Sysutils.pas feature to return to double-word string under small-write form Description I can't test it. Reference function windows.charLowerBuffW example edit2.text: = widelowercase (edit1.text); ━━━━━━━━━━━━ ━━━━━━━━━━ 首 The first Function WideCompareStr (Const S1, S2: WideString): Integer; $ [SYSUTILS.PAS feature Return to compare two double-byte string Description When S1> S2 return value> 0 When S1 S2 return value> 0; when S1

$ [SYSUTILS.PAS headlight (const s: wideString): WideString; overload; $ [systemils.pas feature returns to remove string S left invisible characters Description less than # 32 Character as invisible character reference function system.copy Example edit2.text: = trimleft (edit1.text); ━━━━━━━━━ 首 首━━━━━━━━━ 首 f━━━::::: string; overload; SYSUTILS.PAS headlights: wideString; overload; $ [sysutils.pas feature returns to remove string s On the right side of the keyword Description Small than # 32 Character as an invisible character reference Function System.copy Example Edit2 .Text: = trimright (edit1.text); ━━━━━━━━━ 首 首━━━━━━━━ 首 首 首 f━::::: 首; $ [sysutils.pas function Returns a string S in the expression of the manifestation in Pascal, one of the single quotes will be converted to two reference procedure system.insert example edit2.text: = quotedstr (edit1.text); ━━━━━━━━━━━ ━━━━━━━━━━ 首 首 首 f f f f f f f (Const S: String; Quote: CHAR): String; $ [SYSUTILS.PAS feature Returns Strings S with character quote specifically "ANSIQUOTEDSTR (' Hello "World ',' @ ') =' @ Hello" World @ '; ANSIQUOTEDSTR (' HE LLO "world ','") = '"hello" "world" reference function sysutils.ansistrscan example edit2.text: = ANSIQUOTEDSTR (edit1.text,' "); ━━━━━━━━━━━ ━━━━━━━━ 首 首 首 f f f f;; quote: char): String; $ [sysutils.pas feature Returns the expression of character quote as quotation marks in the form of illegal SRC /// otherwise becomes empty reference function SysUtils.AnsiStrScan example Begin AnsiExtractQuotedStr procedure TForm1.Button1Click (Sender: TObject); var P: PChar; begin P: = PChar (Edit1.Text); Edit2.Text: = AnsiExtractQuotedStr (P, '"'); Edit3.text: = p; end;

/// End AnsiextractquotedSTR ━━━━━━━━━ 首 首━━━━━━ 首 首 首 首 首 首━━ 首 首 首 首 首 首 首; (const s: string; aquote: char): String; $ [sysutils.pas feature return Character AQUOTE is an original form of a quotation indicating that the expression is illegal, returns to the s reference function sysutils.ansiextRactQuotedSTR example edit2.text: = ansidequotedstr (edit1.text, '"); ━━━━━━━━━━━━━ ━━━━━━━━━ header function AdjustLineBreaks (const S: string; Style: TTextLineBreakStyle = {$ IFDEF LINUX} tlbsLF {$ ENDIF} {$ IFDEF MSWINDOWS} tlbsCRLF {$ ENDIF}): string; $ [SysUtils. PAS feature returns to the CR / LF sequence to adjust the gauge string Description AdjustLineBreaks ('1' # 13'2 '# 13) =' 1 '# 13 # 10'2' # 13 # 10; AdjustLineBreaks '1' # 10'2 '# 10) =' 1 '# 13 # 10'2' # 13 # 10 Reference Function Sysutils.StrNextchar Example ━━━━━━━━━━━━━━━ ━━━━━ ━ 首 首c iv: boolean; $ [sysutils.pas function Return string ident is the correct identifier Description Identifier :: Letter | Underline [Letter | Underline | Number]. .. Reference example checkbox1.checked: = isvalidident (edit1.text); ━━━━━━━━━ 首 首 首━━━━━━━━━ 首 首 首 f━━━━━━━━━ 首 首 首 首━━━━━━━━━ 首 首 首━━━━━━━━━━━━ 首(Value: integer): String; OverLoad; $ [sysutils.pas headlight Function INTTOSTR (value: int64): string; overload; $ [sysutils.pas feature return integer value translation into string Description Format ('% d', " Value]) Reference function sysutils.fmtstr example edit2.text: = INTTOSTR (Spinedit1.Value); ━━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━━━ ((value: integer; Digits: integer: String; OverLoad; $ [sysutils.pas headfaster Function INTTOHEX (value: integer): string; overload; $ [sysutils.pas feature return integer value translation into hexadecimal results; format ('%. * x', [DIGITS, VALUE]) Description Parameter DIGITS Specifies the minimum width of the character;

When the minimum width is insufficient, use 0 to fill the reference function sysutils.fmtstr example edit2.text: = INTTOHEX (Spinedit1.Value, Spinedit2.Value); ━━━━━━━━━━━━━━━━━━━━━━ ━ The first Function StrtOINT (Const S: String): Integer; $ [SYSUTILS.PAS feature Return String S Convert to Integer Description String Non Integer Expression will cause anomalous reference process1.value: = start (Edit1) .Text); ━━━━━━━━━━━━━━━━━━━ 首 首 首 f f━━━: 首 首 首 首 f:: Integer; $ [sysutils.pas feature return string S-converted into an integer description string non-integer expression When returns a default value Default reference procedure system.val example spinedit1.value: = startdef (edit1.text, 0); ━━━━━━━━━━━━━━ ━━━━━━ The first function trystrtOint (const s: integer): boolean; $ [sysutils.pas feature Returning String S) Returns False when the string is not integrated Value 0 is output as the reference example System.Val procedure /// Begin TryStrToInt procedure TForm1.Button1Click (Sender: TObject); var I: Integer; begin CheckBox1.Checked: = TryStrToInt (Edit1.Text, I); SpinEdit1.Val UE: = i; end; /// endsSTRTOINT ━━━━━━━━ 首 首 首 首━━━━━━ 首 首 首 首━━━━:: 首 首 首━::::: int64; $ [sysutils.pas Function Returns String S Converts to Sixty-Four Integers Description Strings Non-Sixty-four-bit integers, will cause an exception reference procedure system.val example spinedit1.value: = strt64 (edit1.text); ━━━━━━ ━━━━━━ 首 首━━━━━━ 首 首 首 首━ 首 首 首 首 首 首 (const); const default: int64): int64; $ [sysutils.pas function return string S converted to sixty-four-bit integer description String Non 64-bit integer expression When returning to default value Default reference process1.value: = start64def (edit1.text, 0); ━━━━━━━━━━━━━━━━━ ━━━━━ The first Function trysTRTOINT64 (Const S: String; Out value: int64): boolean;

$ [SYSUTILS.PAS feature Returns Strings S converted to sixty-four-bit integers value to successfully describe the string Non 64-bit integers to return false and value will output to 0 reference procedure system.val example // Begin TrystrtOint64 Procedure tform1.button1click (sender: Tobject); var i: int64; begin checkbox1.checked: = trystrthannel64 (edit1.text, i); spinedit1.value: = i; end; /// end trystrt64 ━━━━━━━ ━━━━━━ 首 首 首━━━━ 首 首 首 首 首 首 首 (const S: String): Boolean; $ [sysutils.pas feature Returns String S Convert to logic values ​​Description Character non-logical expression will cause exceptions Reference function sysutils.trystrtobool example checkbox1.checked: = stratobool (edit1.text); ━━━━━━━━━ 首 首━━━━━━━━━━ 首 首━━━━━━━━━ 首 首 首 首 f━━ ((((((((((( : Boolean; $ [sysutils.pas feature Returning String S Convert to logic value Description Character Non-logical expression When returning to default value default reference function sysutils.trystrtobool example checkbox1.checked: = stropoldef (Edit1.Text, false) ; ━━━━━━━━━━━ 首 首━━━━━ 首 首 首 首 f f; (all value: boolean): Boolean; $ [sysutils.pas.pas Function Return String S Convert to Logic Value Successful Successful Description [Note] 0 is true; not 'true' and 'false'; Delphi6 BUG Corply refer to Function Sysutils.ansisametext; var sysutils.trueboolstrs; var sysutils examples .FalseBoolStrs /// Begin TryStrToBool procedure TForm1.Button1Click (Sender: TObject); var B: Boolean; begin SetLength (TrueBoolStrs, 2); SetLength (FalseBoolStrs, 2); TrueBoolStrs [0]: = 'True'; FalseBoolStrs [ 0]: = 'false'; TrueBoolSTRS [1]: = 'yes'; falseBoolSTRS [1]: = 'NO'; checkbox1.checked: = trysTRTOBOOL (Edit1.Text, b); checkbox2.checked: = b; END ;

/// End TryStrToBool additional /// Begin TryStrToBool function TryStrToBool (const S: string; out Value: Boolean): Boolean; function CompareWith (const aArray: array of string): Boolean; var I: Integer; begin Result: = False For i: = low (aaarray) to high (aaRray) DO if Ansisametext (s, AARRAY [I]) THEN BEGIN Result: = true; break; end; end; var lresult: extended; begin result: = trysTRTOFLOAT (S , LResult); if Result then Value: = LResult <> 0 else begin Result: = True; // amendments are VerifyBoolStrArray; if CompareWith (TrueBoolStrs) then Value: = True else if CompareWith (FalseBoolStrs) then Value: = False else Result : = False; end; end; /// end trystrtobool ━━━━━━━━ 首 首 首━━━━━━━━ 首 首 首━━━t━━ ((((首tttt (B: Boolean; Usebook): String ; $ [Sysutils.pas feature return logic value B converted to string Description BoolTostr (false, false) = '0'; booltos Tr (false, true) = '- 1' refer to var sysutils.trueBoolstrs; var sysutils.falseBoolSTRS example Edit1.text: = booltostr (checkbox1.checked, checkbox2.checked); ━━━━━━━━━━━━━ ━━━━━━━ 首 首 Function LoadStr (Ident: Integer): String; $ [SYSUTILS.PAS feature Returns String Resource Reference Function Sysutils.FindStringResource Edit2.text: = loadingStr (strtointdef (edit1.text, 0)); ━━━━━━━━━ 首 首 首━━━━━━━━━ 首 首━━━━━━━━━ 首 首 f━━;; Const Args: array Of const; [sysutils.PAS feature Return Formatted string Resource Description String Resource is the internal resources of the program reference function sysutils.fmtstr; function sysutils.findstringResource example ;

━━━━━━━━━━━━━━━━ 首 首 首 首 首 f 首 首: 首;; $ [SYSUTILS.PAS feature returns the length of the pointer string Description When the pointer string When Str is NIL, it will trigger an abnormality reference example spinedit2.value: = strlen (pchar (edit1.text)); ━━━━━━━━━━ 首 首━━━━━━━━━ 首 首 首 f━━━━━━━━━━ 首Strend (const str: pchar): PCHAR; $ [sysutils.pas feature returns the end of the pointer string Description When the pointer string STR is NIL, the exception reference example edit2.text: = stread (pchar (edit1). TEXT)) - Spinedit1.Value; ━━━━━━━━ 首 首 首━━━━━━━ 首 首 首━━━━; ((首 首 f f f; Const Source: Pchar; Count: Cardinal: Pchar; $ [SYSUTILS.PAS feature returns to specify the number of memory Source Specified memory COOUNT COUNT Copy Override to Point String Dest Description DEST No Distribution Resources will trigger an exception S reference Function System.move example /// begin Strmove Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT); VAR VBUFFER: PCHAR; Begin vbuffer: = '0123456789; Strmove (vbuffer, pchar (edit1.text), spinedit1.value; edit2.text: = vbuffer; end; /// end strmove ━━━━━━━━━ ━━━━━━━ 首 首━━━━━━━ 首 首 f f━━━━━ 首 f f f━;;;; CO Nst Source: Pchar): Pchar; $ [SYSUTILS.PAS feature Returns to copy the pointer string source to the pointer string DEST Description DEST Dest should assign enough space to trigger an exception reference example /// begin strcopy procedure TForm1.Button1Click (Sender: TObject); var vBuffer: PChar; begin GetMem (vBuffer, Length (Edit1.Text) 1); StrCopy (vBuffer, PChar (Edit1.Text)); Edit2.Text: = vBuffer; FreeMem (vbuffer); end; /// end strcopy ━━━━━━━━ 首 首 首 首━━━━━━━ 首 首 首 首 f━;;; ;━ 首 首 首 f; Const Source: Pchar): Pchar; $ [ SYSUTILS.PAS feature returns the end of the pointer string source to the pointer string DEST instructions can be connected to the pointer string reference

Example // Begin Strecopy Procedure TFORM1.BUTTON1CLICK (Sender: Tobject); Var vbuffer: array [0..255] of char; begin strecopy (strecopy (vbuffer, pchar (edit1.text)), Pchar (Edit2.Text) Edit3.Text: = vbuffer; end; /// end streecopy ━━━━━━━━━ 首 首━━━━━━━ 首 首 首 f━━━━━━ 首;; Const Source: pchar; Maxlen: cardinal): PCHAR; $ [SYSUTILS.PAS feature returns to copy the pointer string Source Specify length Maxlen to Pointer string DEST Description DEST Description Dest should have assigned enough space to trigger an abnormal reference example //// Begin StrLCopy procedure TForm1.Button1Click (Sender: TObject); var vBuffer: array [0..255] of Char; begin StrLCopy (vBuffer, PChar (Edit1.Text), SpinEdit1.Value); Edit2.Text: = vBuffer; end ; /// end strlcopy ━━━━━━━━━ 首 首 首━━━━━━━ 首 首 首━━━━;; const source: string: pchar; $ [sysutils.pas feature returns Copy the pointer string source to the pointer string DEST Description Strlcopy (DEST, PCHAR (SOURCE), Length) Reference Function Sysutils.Strlcopy Sub // Begin Strpcopy Procedure TFORM1.BUTTON1CLICK (Sender: Tobject); var vbuffer: array [0..255] of char; begin strpcopy (vbuffer, pchar (edit1.text)); edit2.text: = vbuffer; end; ; /// end strpcopy ━━━━━━━━━ 首 首 首━━━━━━━ 首 首 f━━━;;;;; 首 首;;; Const Source: string; Maxlen: cardinal: Pchar; $ [sysutils .pas return function copies the string length specified MaxLen Source to Dest string pointer described StrLCopy (Dest, PChar (Source), MaxLen) the reference function SysUtils.StrLCopy example /// Begin StrPLCopy procedure TForm1.Button1Click (Sender: TObject) Var vbuffer: array [0..255] of char; begin strplcopy (vbuffer, edit1.text, spiffit1.val); edit2.text: = vbuffer;

End; /// end strplcopy ━━━━━━━━ 首 首 首━━━━━━━ 首 首 首 首 首;;;;;;;; const source: pchar): pchar; $ [sysutils.pas function Returns the connection pointer string Dest and pointer string Source Description Strcopy (Strend (DEST), SOURCE Reference Function Sysuntils.Strcopy Example // Begin Strcat Procedure TFORM1.BUTTON1CLICK (Sender: Tobject); var vbuffer: array [0 .. 255] of char; begin strpcopy; strcat (vbuffer, pchar (edit2.text)); edit3.text: = vbuffer; end; /// end strcat ━━━━━━━━━ ━━━━━━━━━━ 首 The headlight strlcat (DEST: PCHAR; Const Source: pchar; maxlen: cardinal): PCHAR; $ [sysutils.pas feature return connection pointer string DEST and pointer string SOURCE description [Note] Maxlen specifies the maximum length of the connection not the length of the pointer string Source Reference example /// begin strlcat procedure tForm1.Button1Click (sender: TOBJECT); var vbuffer: array [0..255] of char; Begin Strpcopy; strlcat (vbuffer, pchar (edit2.text), spinedit1.value; Edit3.Text: = VBUF FER; End; /// end strlcat ━━━━━━━━━ 首 首 首━━━━━━ 首 首 首 首 首 f━ 首 首 首 首 首 首; $ [sysutils.pas feature Returns two pointer string description When S1> S2 returns value> 0; when S1 example spinedit1.value: = strcomp (pchar (edit1.text), pchar (edit2.text)); ━━━━━━━━━━ 首 首━━━━━━━━━━ 首Function StriComp (const str1, str2: pchar): Integer; $ [sysutils.pas feature returns two pointer string description When S1> S2 return value> 0; when S1 example spinedit1.value: = StriComp (pchar (edit2.text));

━━━━━━━━━━━━━━━━━━━━ 首 首 首 首 f 首 f 首 首 f f f; Maxlen: Cardinal: Integer; $ [SYSUTILS.PAS feature Returns Two pointers String specification length Description When S1> S2 returns value> 0; when S1 Example Spinedit1.Value: = Strlcomp (Pchar (Edit1.Text), Pchar (Edit2.Text), Spiedit2.Value) ━━━━━━━━━━━━━━━━━━━━━ ━━━ The first Function strlicomp (const str1, str2: pchar; maxlen: cardinal): Integer; $ [sysutils.pas feature Returns Two pointer strings Specify length Description When S1> S2 return value> 0; when S1 < S2 return value <0; when S1 = S2 returns value = 0; not case sensitive; [Note] Returns the first difference reference example spinedit1.Value: = strlicomp (pchar (edit1.text) , Pchar (edit2.text), spinedit2.value) ━━━━━━━━━ 首 首 首━━━━━━ (首 首 首━━━ ((((Const str: pchar; chr: char): pchar; $ [SYSUTILS.PAS function Returns the address of the pointer string STR Search Character ChR The first address description is not found, return to the empty pointer reference example edit2.text: = strscan (pchar (edit1.text), '*') ━━━━━━━━━━ 首 首━━━━━━━ 首 首 首 f f;; (Const str: pchar; chr: char): Pchar; $ [sysutil S.PAS feature Returns the address of the pointer string STR Search Character CHR The last appearance address Description None, return to the empty pointer reference example edit2.text: = STRSCAN (Pchar (edit1.text), '*'); ━ ━━━━━━━━ 首 首━━━━━━━ 首 首 首━━━━ 首 首 首 f f;;; Pchar; $ [SYSUTILS.PAS feature Returns the first string STR2 in STR1 first An appearance address shows that the empty pointer is not found; STRPOS ('12345', '3') = '345' refer to example edit3.text: = strpos (pchar (edit1.text), pchar (edit2.text) )))); ━━━━━━━━━ 首 首 首━━━━━━━ 首 The first Function Strupper (str: pchar): Pchar; $ [sysutils.pas feature return pointer string STR write instructions non-lowercase Character does not process reference example edit1.text: = Strupper (pchar (edit2.text));

━━━━━━━━━━━ 首━━━━━━━━ 首 首 f 首 f::: (Str: Pchar): Pchar; $ [SYSUTILS.PAS feature Return Point string STR lowercase Description non-uppercase characters do not process Reference example edit1.text: = strlower (pchar (edit2.text)); ━━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━━━━ ((首 首 首━━━━━ ((((( : String; $ [SYSUTILS.PAS feature Returns string STR Convert into string Description You can also directly assign a reference example edit1.text: = strpas (pchar (edit2.text)); ━━━━━━━ ━━━━━━━━━━━ 首 The first Function Stralloc (Size: cardinal): PCHAR; $ [sysu onils.pas feature Returns the memory resource of the assigned specified space to the pointer string Description space size will also be saved; all references to release with StrDispose System.GetMem example function /// Begin StrAlloc procedure TForm1.Button1Click (Sender: TObject); var P: PChar; begin P: = StrAlloc (SpinEdit1.Value); ShowMessage (IntToStr (StrLen (P) )); DEC (p, sizeof (cardinal)); SHOWMESSAGE (POINTER (P) ^)); Inc (p, sizeof (cardinal)); strDispose (p); end; /// end stralloc

━━━━━━━━━━ 首 首━━━━━━━ 首 首 首 首 f f::: Cardinal; $ [sysutils.pas feature returns the buffer size instructions allocated by the function stralloc An exception situation returns an unpredictable result reference function system.sizeof example spinedit1.Value: = strbufsize (stralloc (spinedit2.value)); ━━━━━━━━━━━━━━━━━━━━━ The first Function strnew (const str: pchar): PCHAR; $ [sysutils.pas feature Returns a new pointer string indicates that if the Str is NIL, return nil reference function sysutils.strlen; function systemils.strmove; function sysutils.stralloC example /// begin strnew, strdispose procedure tform1.button1click (sender: TOBJECT); VAR P: ​​PCHAR; Begin P: = strnew (pchar (edit1.text)); showMessage (P); strdispose (p); end; // / End strnew, strdispose ━━━━━━━━━ 首 首━━━━━━━ 首 首 首━━━━━;; $ [sysutils.pas feature release pointer string STR memory resource note The STR is NIL without any processing; and releases space size information reference function system.dec; function system.sizeof; function system.freemem example ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━ The first FUNCT ION Format (const format: string; constrays: array of const): String; $ [sysutils.pas function Return to format a array constant in the specified mode Description This function is the most used function in Delphi, Now list a few examples to give you an intuitive understanding "%" [index ":"] ["-"】 "" summary] type Format ('x =% d', [12]); // 'x = 12' // Most normal format ('x =% 3D', [12]); // 'x = 12' // Specify the width Format ('x =% f', [12.0]); // '= 12.00' // floating point FORMAT ('x =%. 3F', [12.0]); // '= 12.000' // Specify decimal format ('x =%. * f', [5 , 12.0]); // 'X =%. 5D', [12]); // 'x = 00012' // front Supplement 0 Format ('x =%. 5x ', [12]); //' x =

0000c '// hex Format Format (' x =% 1: D% 0: D ', [12, 13]); //' x = 1312 '// Using Index Format (' x =% P ', [NIL]); // 'x = 00000000' // Pointer format ('x =% 1.1e', [12.0]); // '=1.2e 001' // Scientific counting method Format ('x = %% ', []); //' x =% '// Get "%" s: = format ('% s% d ', [s, i]); // s: = s strtoint ( I); // Connecting string reference processuer sysutils.fmtstr example edit1.text: = format (edit2.text, [strMLoATDEF (edit.3.text, 0)]); ━━━━━━━━━━━━━ ━━━━━━━━ 首 The first procedure fmtstr (var result: string; const format: string; const arggs: array of const); $ [sysutils.pas feature is formatted in the form of a character form in the specified manifold. Description Refer to Function System.Length; Function System.Length; Function System.SetLength Example ━━━━━━━ 首 首 首━━━━━━━ (首 首 首 首 首 f ((((( Buffer, Format: Pchar; Const Args: Array Of Const: Pchar; $ [SYSUTILS.PAS feature Returns a character pointer formatted in the specified method to format a array constant. If Buffer and Format are returned to NIL reference Function sysutils.formatbuf example ━━━━━━━━━ 首 首 首 首━━━━━━ 首 首 首 f f 首 f━━ffff T (Buffer: Pchar; Maxbuflen: Cardinal; Format: Pchar; Const args: array of const): PCHAR; $ [SYSUTILS.PAS feature returns a character pointer format Strlfmt (vbuffer, 6, '% D | 12345', [1024]) = '1024 | 1'; Reference function sysutils.formatbuf example ━━━━━━━━━━━━━━━━━ The first Function Formatbuf (var buffer; buflen: cardinal; const form: array ipas: cardinal; $ [sysutils.pas feature returning to formatting an array constant to buffer buffer in a specified manner Reference Example

━━━━━━━━━━━━━━━━━━━━ 首 首 首 首 f 首;; ;━ 首 首 首 f w;; Const Args: Array Of Const: WideString; $ [SYSUTILS.PAS feature Return Press Mode Format a multi-character form of a array constant Description Reference procedure sysutils.Widefmtstr example ━━━━━━━ 首 首━━━━━━━━━ 首 首 首━ 首 ((((((( Var Result: WideString; const format: wirestring; const args: array of const); $ [sysutils.pas feature Returns a multi-byte character form of an array constant by specifying the multi-character character form: Reference function sysutils.WideFormatbuf example < See Format> ━━━━━━━━━ 首 首 首━━━━━━ 首 首 首 首 首 f f f: (var buffer; buflen: cardinal; const format; fmtlen: cardinal; const args: array of const): Cardinal; $ [SYSUTILS.PAS feature returns to format an array constant to the buffer buffer in the buffer refer to example ━━━━━━━━━━━━━━━━━ ━━━━━ 首 首 首 首 首 f:: String; $ [sysutils.pas feature Return floating point value VALUE Convert into string Description When the floating point is equal to 1E15 will adopt a scientific number of minutes reference function sysutils.floatTEXT example Edit1.text: = floattostr (now); ━━━━━━━━━━━ 首━━━━━━━ 首 首 首 f f::::: String; $ [SYSUTILS.PAS feature Return currency VALUE Convert to string Description currency only Keep four decimals reference function sysutils.floattotext example Edit1.text: = currtostr (now); ━━━━━━━━ 首 首 首━━━━━━━━━ 首 首 首━━━━ (((((const value: Extended) : Currency; $ [sysutils.PAS feature Returns floating point value VALUE Converted to currency Number Description If the floating point value value is exceeding the range, the exception reference const system means.mincurrency; const system tcCurrency EDIT1.TEXT: = Currtostr (FLOATTOCURR (now) ); ━━━━━━━━━━ 首━━━━━━━━━ The first Function Floattostrf (Value: Extended; Format: Tfloatformat; Precision, Digits: Integer): String; $ [sysutils.pas function Returns the floating point number to the specified format into string Description precision specifies accuracy;

Decimal Digits specified width of the reference function SysUtils.FloatToText example /// Begin FloatToStrF procedure TForm1.Button1Click (Sender: TObject); begin Memo1.Lines.Values ​​[ 'ffGeneral']: = FloatToStrF (StrToFloatDef (Edit1.Text, 0), ffGeneral , Spinedit1.Value, Spinedit2.Value; Memo1.Lines.Values ​​['ffexponent']: = floattostrf (strtOFLoATDEF (Edit1.Text, 0), ffexponent, spinedit1.value, spinedit2.value; memo1.line.values ​​[Memo1.Lines.Values 'ffFixed']: = FloatToStrF (StrToFloatDef (Edit1.Text, 0), ffFixed, SpinEdit1.Value, SpinEdit2.Value); Memo1.Lines.Values ​​[ 'ffNumber']: = FloatToStrF (StrToFloatDef (Edit1.Text, 0) , FFNUMBER, SPINEDIT1.VALUE, SPINEDIT2.VALUE; MEMO1.LINES.VALUES ['FFCURRENCY']: = FLOATTOSTRF (StrtOFLOATDEF (Edit1.Text, 0), Ffcurrency, Spinedit1.Value, Spinedit2.Value; end; // / End floattostrf ━━━━━━━━━ 首 首 首━━━━━━━ 首 首 f━━━━━━ 首 首 首 (value: currency; format: tfloatformat; Digits: integer): String; $ [sSUTILS .pas function returns the type of currency converted into a string in the specified format described Digits specified fractional width of the reference function SysUtils.FloatToText example /// Begin CurrToStrF procedure TForm1.Button1Click (Sender: TObject); begin Memo1.Lines.Values ​​[ 'ffGeneral'] : = CurrToStrF (StrToCurrDef (Edit1.Text, 0), ffGeneral, SpinEdit1.Value); Memo1.Lines.Values ​​[ 'ffExponent']: = CurrToStrF (StrToCurrDef (Edit1.Text, 0), ffExponent, SpinEdit1.Value); Memo1.Lines.Values ​​[ 'ffFixed']: = CurrToStrF (StrToCurrDef (Edit1.Text, 0), ffFixed, SpinEdit1.Value); Memo1.Lines.Values ​​[ 'ffNumber']: = CurrToStrF (StrToCurrDef (Edit1.Text, 0), FFNUMBER, SPINEDIT1.VALUE);

Memo1.Lines.values ​​['FFCurrency']: = CURRTOSTRF (Strtocurrdef (Edit1.Text, 0), FFCurrency, Spinedit1.Value); end; /// end currtostrf ━━━━━━━━━━━━━━━━━━━━ ━━━━━━━ 首 The headlight floattotext (bufferg: pchar; const value; value; tfloatformat; precision, digits: integer): Integer; $ [sysutils.pas function returns floating point number to specify format Memory size of the pointer string Description precision specifies accuracy; DIGITS specifies the decimal width reference example /// begin floattotext procedure tform1.button1click (sender: Tobject); var vbuffer: array [0..255] of char; E: Extended; Begin E: = STRTOFLOATDEF (Edit1.Text, 0); Spinedit3.Value: = floattotext (vbuffer, e, fvextended, ffnumber, spinedit1.value, spinedit2.value); Edit2.Text: = Copy (vbuffer, 1, Spo; /// end floattotext (━━━━━━━━ 首 首━━━━━━━━ 首 首 首 f━━━━━━ 首 首 ": string; String; $ [Sysutils.pas feature returns the floating point type type to specify the format string Format converted into strings Description Format Float (',. 00', 1234567890) = '1, 234, 567, 890.00' Reference function sysutils.floattotextfmt example edit1.text: = formatfloat (edit2.text, strtofloatdef (edit3.text, 0)); ━━━━━━━━━ ━━━━━━━━━ 首 首 The first Function Formatcurr (const format: string; value: currency): String; $ [systemils.pas feature Returns the currency type to specify the format string Format converted into string Description FormatCurr ', .00', 1234567890) = '1,234,567,890.00' Reference function sysutils.floattlextfmt example edit1.text: = formatcurr (edit2.text, stratocurrdef (edit3.text, 0)); ━━━━━━━━━━━━ ━━━━━━━━ 首 The headlight floattotextfmt (BUF: Pchar; Const value; ValueType: Tfloatue; Format: Pchar): Integer;

$ [SYSUTILS.PAS feature Returns the floating point number to specify the format string Format Convert Memory Size Memory Size Description VALUETYPE Specifies the Type of Nothing Parameter Value Reference Example // Begin FloattotextFmt Procedure TFORM1.B /BUTTON1CLICK (Sender: Tobject VAR VBUFFER: Array [0..255] of char; e: extended; begin E: = struploatdef (edit1.text, 0); spinedit1.value: = floattotextfmt (vbuffer, e, fvextended, pchar (edit2.text )); Edit3.text: = Copy (vbuffer, 1, spinedit1.value); end; /// end floattlextFMT ━━━━━━━━ 首━━━━━━━━━━━ 首 首 首━━━━━━━━━ 首 首(const S: String): Extended; $ [sysutils.pas function Returns String S Convert to floating point number Description String non-floating point number When expressing the abnormal reference function sysutils.texttofloat example var E: Extended; Begin E: = StrtOFLOAT (Ed;); PAS function Returns String S Convert to floating point number Description String Non-floating point Number Expression Returns Default Reference Function Sysutils.TextTOFLOAT Example Var E: Extended; Begin E: = STRTOFL OATDEF (Edit1.Text, 0); END; ━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━━━━: 首::: Extended: Boolean; OverLoad ; $ [SysUtils.pas header function TryStrToFloat (const S: string; out Value: Single): Boolean; overload; $ [SysUtils.pas header function TryStrToFloat (const S: string; out Value: Double): Boolean; overload; $ [SYSUTILS.PAS feature Returns String S Convert to floating point VALUE Successfully describe the string non-floating point number expression Returns false and value will output a value of uncertain reference function sysutils.texttofloat example // Begin Trystrtofloat Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT); VAR E: Extended; Begin Checkbox1.checked: = trystrtofloat (edit1.text, e); edit2.text: = formatfloat (''

, E); end; /// end trystrtofloat ━━━━━━━━ 首 首 首 首━ 首 首 (首 首 首 首 ((const s: string): currency; $ [sysutils.pas function Returns String S Convert to Currency Number Description String Non-currency Noncural Expression will cause an exception reference function sysutils.textTOFLOAT example var C: currency; begin c: = straopcurr (edit1.text); end; ━━━━━━━ ━━━━━ 首 首 首━━━━ 首 The first Function Strtocurrdef (const default: currency): currency; $ [sysutils.pas feature return string S converted to currency Number Description String Non-currency Number expression returns a default value default reference function sysutils.textTOFLOAT example var C: currency; recomcar c: = strangurrdef (edit1.text, 0); End; ━━━━━━━━━━━━━━━ ━━━━ 首 The first Function trysTRTOCURR (Const S: string; out value: currency): boolean; $ [sysutils.pas feature Returning String S) VALUE Successfully Describes String Non-currency Number Expression Returns false and value output /// Begin TryStrToCurr procedure TForm1.Button1Click reference value function SysUtils.TextToFloat example indeterminate (Sender: TObject); var C: Currency; begin CheckBox1.Checked: = TryStrToCurr (Edit1.Text, C); Edit2.text: = formatcurr ('', c); end; /// end trystrtocurr ━━━━━━━━ 首 首━━━━━━━━━ 首 首━━━━━━━━━ (首 首━:::;; var; var VALUE; VALUETYPE: TFLOATVALUE): Boolean; $ [sysutils.pas feature returns to convert the pointer string buffer into a non-type variable VALUE Description ValueType Specifies the type of non-type parameter VALUE Type reference example // begin textttofloat Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT); VAR E: Extended; Begin Checkbox1.checked: = texttOfloat (pchar (edit1.text), e, fvextended; ed2.text: = formatfloat ('', e); end; /// end TEXTTOFLOAT ━━━━━━━━━━ 首 首 首━━━━━━ 首 首 f━━━━━))))): String;

$ [SYSUTILS.PAS function return date DateTime Convert to string Description conversion format constructed by system variable shortdateformat control reference function sysutils.datetimetostring; var sysutils.shortdateformat EDIT1.TEXT: = DATETOSTR (date); ━━━━━━━━━━ ━━━━━━━━━━━ 首 The first Function Timetostr (const datetime: tdatetime): String; $ [sysutils.pas feature return time DateTime Convert to string Description Translation format The system variable LongTimeFormat control reference function sysutils. DateTimetString; var sysutils.longtimeformat eDit1.text: = Timetostr (date); ━━━━━━━━ 首 首 首━━━━━━━━ 首 首━━━━━━━━━ 首) )━━)))): String Download Adobe Reader DateTime: TDATETIN $ [SYSUTILS.PAS feature return date Time DateTime Convert to string Description Conversion Format The system variable ShortdateFormat and LongTimeFormat Control reference function sysutils.datetimetostring example edit1.text: = DateTimetostr (now); ━━━━━━━━━━━━ ━━━━━━━━━ 首 The first Function Strtodate (const s: string): TDATETIME; $ [systemils.pas feature return string S Convert to date Description Character Non-date Expression will cause an exception reference function sysutils.tryStodate Example DateTimePicker1.Date: = stradate (edit1.text); ━━━━━━━━━━━━━━━━━━━ ━━━ The first Function Strtodatedef (const default: tdatetime): tdatetime; $ [systemils.pas feature Return String S Convert to date Description Character Non-date Expression When you return to the default value Default reference Function Sysutils.TryStodate example DateTimePicker1.Date: = stradateDef (edit1.text, date); ━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━━━━━━ 首 首 首 f:;: TDATETIME: Boolean; $ [sysutils.pas function Returns Strings S Convert to Date Value Successfully Description Character Non-Date Expression Returns False and Value will output example /// begin trysTRTODATE Procedure TFORM1.BUTTON1CLICK (Sender: Tobject ); Var vdatetime: tdatetime; begin checkbox1.checked: = trystodate (edit1.text, vdatetime); DateTimePicker1.date: = vdatetime

End; /// end trystodate ━━━━━━━━━━━━━━━ 首 首 首 首 首 首 首:::: TDATETIME; $ [SYSUTILS.PAS feature Returns Strings S Converting Time Description Character Non-Time Expression will cause an exception reference function sysutils.tryStotime example DateTimePicker1.Time: = startIME (edit1.text); ━━━━━━━━━━━━━━━━━━━━ ━ header function StrToTimeDef (const S: string; const default: TDateTime): TDateTime; $ [SysUtils.pas function returns a string S is converted to the default value default time reference function SysUtils.TryStrToTime example DateTimePicker1 is returned if the character is not time expression. Time: = strtotimedef (edit1.text, time); ━━━━━━━━━ 首 首━━━━━━━━ 首 首 f━━━━━ ((const S: string; out value: tdatetime): boolean; $ [SYSUTILS.PAS feature Returns String S Convert to Time Value Successfully Successfully Describes Character Non-Time Expression Returns False and Value will output Example /// Begin Trystotime Procedure TFORM1.BUTTON1CLICK (Sender: TOBJECT); Var vdatetime: tdatetime; begin checkbox1.checked: = trystotime (edit1.text, vdatetime); DateTimePicker1.Time: = vdatetime End; /// end trystotime ━━━━━━━━━━ 首━━━━━ 首 首 首 首 首 f:: 首 首 (const s: string): tdatetime; $ [sysutils.pas feature returns string S Converting Date Time Description Character Non-Date Time Expression will cause an exception reference function sysutils.trystodatetime example edit1.text: = DATETITOSTR (STRTODATETIME (EDIT2.TEXT)); ━━━━━━━━━━━━━━━━━━━━ ━━━━━ ━ 首 首c f;; const default: tdatetime; tdatetime; $ [systemils.pas feature return string S converted to date Time Description Character Non-date Time Expression Returns Default Reference Function sysutils.trystrtodatetime example edit1.text: = DateTimetostr (strtodatetimedef (edit2.text, now)); ━━━━━━━━━ 首 首━━━━━━━━━ 首 首 f━━━━━━━ ((Const S: String; out value: tdatetime): boolean;

$ [SYSUTILS.PAS function Returns String S Convert to Date Time Value Successfully Describes the character Non-date time Returns false and value will output to 0 reference example /// begin tryston1click (sender: Tobject) Var vdatetime: tdatetime; begin checkbox1.checked: = trystetodatetime (edit1.text, vdatetime); edit2.text: = DateTimetostr (vdatetime); end; /// end trystrtodatetime ━━━━━━━━━━ ━━━━━━━━ 首 The first procedure: string; const format: string; datetime: tdatetime); $ [sysutils.pas function with the specified format format to format the date time DateTime and return to the character String Result Reference Function System.setString Examples ━━━━━━━━ 首 首 首━━━━━━━━ 首 首 首 首━━━━━━ 首 首 首 (;;; ;━━ ;━━ ((Locale, LocaleType: Integer; Const Default: string): string; platform; $ [SysUtils.pas system function returns the current value of the specified parameter string Description GetLocaleStr (GetThreadLocale, LOCALE_SLANGUAGE, '') = 'Chinese ()' function Windows.GetLocaleInfo reference example Edit1.Text : = GetLocalestr (GetThre Adlocale, Spinedit1.Value, ''); ━━━━━━━━━ 首 首━━━━━━━━ 首 首━━━━━━━ ((Locale, LocaleType: Integer; Default: char): char ; platform; $ [SysUtils.pas function returns the current system parameters specified character value be described GetLocaleChar (GetThreadLocale, LOCALE_STHOUSAND, # 0) = ',' reference function Windows.GetLocaleInfo example Edit1.Text: = GetLocaleChar (GetThreadLocale, LOCALE_SLANGUAGE, # 0 ); ━━━━━━━━━━━━ 首━━━━━━ 首 首 首 首 f 首 首 首 (const S: string; index: integer): TMBCSBYTYPE; $ [sysutils.pas feature returns string S position InDex characters in MBCS Description Multi-byte character system: multi-byte character system system (mbcs) Reference var sysutils.syslocale example spinEdit1.Value: =

ORD (byType (Edit1.Text, Spinedit2.Value)); ━━━━━━━━ 首 首 首━━━━━━━━ 首 首 首━━━━━ ((str: pchar; index: cardinal): TMBCSBYTYPE $ [SYSUTILS.PAS feature Returns the character string STR position index in the MBCS Type Description Index From 0 Reference Var Systemils.syslocale Example Spinedit1.Value: = ORD (StrByType (pchar (pchar (edit1.text), Spinedit2.Value ))); ━━━━━━━━━━━ 首━━━━━━━ 首 首 首 首 f f (((const S: String; Maxlen: Integer): Integer; $ [sysutils.pas feature Return string S How many multi-byte characters in Maxlen specify the number of references for the number of processing characters. Function SYSUTILS.BYTETOCHARINDEX example spinedit1.Value: = bytetocharlen (edit1.text, spinedit2.value); ━━━━ )━━━━━━━━━━━ ━━━━━━ 首 The first Function Chartobytelen (Const S: String; Maxlen: Integer): Integer; $ [SYSUTILS.PAS function Return String S How many characters in the string s Description Maxlen Specifies a number of reference to the multi-byte character Var sysutils.syslocale example spinedit1.value: = chartobytelen (edit1.text, spinedit2.value); ━━━━━━ )━━ 首 首━━━━━━━━━ 首 首 首━━━━━━━ (((Const S: String ; Index: integer: integer; $ [SYSUTILS.PAS feature Returns the multi-byte character position of the character position Description ByTetocharindex ('Hello', 2) = 1; bytetocharindex ('Hello', 3) = 2 Reference function sysutils.nextcharindex example spinedit1.Value: = ByTetocharindex (Edit1.Text, Spinedit2.Value); ━━━━━━━━━ 首 首 首━━━━━━━━ 首 首 首━━━━tt ((Const S: String; Index: Integer; $ [Sysutils.PAS feature Returns the character starting position of the multi-byte character position Description CHARTOBYTEINDEX ('Hello', 1) = 1; ChartobyteIndex ('Hello', 2) = 3 Reference Function System.length Example Spinedit1.Value : = CHARTOBYTEINDEX (Edit1.Text, Spinedit2.Value); ━━━━━━━━━ 首 首━━━━━━━━━ 首 f━━━: (((Const str: Pchar): Integer;

$ [SYSUTILS.PAS feature Returns the first character's width Description Parameters Return 0 Reference function Windows.CharNext Example Spinedit1.Value: = STRCHARLENGTH (PCHAR (EDIT1.TEXT)); ━━━━━━━━━━ ━━━━━━━━━ 首 ━ 首 首 f f:: pchar; $ [sysutils.pas feature Return Character pointer STR's next character pointer Description strnextchar ('1234') = '234' Reference function windows.charnext example edit2.text: = strnextchar (pchar (edit1.text)); ━━━━━━━━━━ 首 首━━━━━━━━ 首 首 f━━━━ (((((Const S: String; index: integer: Integer; $ [sysutils.pas function Returns the character width of the specified location in the string Description Charlength ('English Han, 1) = 1; Charlength (' English Han, 8) = 2 Reference FUNCTION SYSTEM.ASSERT; FUNCTION SYSUTILS.STRCHARLENGTH example spinedit1.value: = charlength (edit1.text, spinedit2.valu); ━━━━━━━━ 首 首━━━━━━━━━━ 首 首 f━━━━ ((( Const S: String; Index: Integer: Integer; $ [Sysutils.PAS function Back to the next character location Description Charlength ('Hello', 1) = 3; Charlength ('Hello', 3) = 5 Reference FUNCTION System.assert; function sysutils.strcharlength Example spinedit1.value: = nextcharindex (Edit1.Text, Spinedit2.Value); ━━━━━━━━━ 首 首━━━━━━━━━ 首 首 f━━━━━━ (((Const S: String; Index: Integer : Boolean; $ [systemils.pas function Returns whether it is a path separator on the specified position index in the string S. ISPATHDELIMITER ('c: / windows', 3) = true reference const system; Checkbox1.checked: = ISPATHDELIMITER (Edit1.Text, Spinedit1.Value); ━━━━━━━━━ 首 首━━━━━━━ (首 首━━━━━ ((Const Delimiters, S: String; Index: Integer: Boolean; $ [systemils.pas function Returns in the specified position index is a separator Delimiters description Isdelimiter ('@', 'WJHU111 @

21cn.com ', 8) = True Reference Function Sysutils.byType Example CheckBox1.checked: = Isdelimiter (Edit1.Text, Edit2.Text, Spinedit1.Value); ━━━━━━━━━━━━━━━━ ━━━━━ ━ 首 首c (const s: string): string; $ [sysutils.pas feature returns to include the last path separator Description The last character is the path separator is constant; otherwise, add a path separator to return reference function SysUtils.IsPathDelimiter; function System.Length example Edit1.Text: = IncludeTrailingPathDelimiter (Edit2.Text); ━━━━━━━━━━━━━━━━━━━━━ header function IncludeTrailingBackslash (const S : string): string; platform; $ [SysUtils.pas function returns information including the last slash Description Result: = IncludeTrailingPathDelimiter (S); an example of the reference function SysUtils.IncludeTrailingPathDelimiter Edit1.Text: = IncludeTrailingBackslash (Edit2.Text); ━━━━ ━━━━━━━ 首 首━━━━━━ 首 首 f━━━━ 首 首 (const S: string): string; $ [systemils.pas feature return exclude Last path separator Description Last character is not a path separator Constant; otherwise subtract the last path separator returns reference function syspathDelimiter; function system.l ENGTH; FUNCTION System.Setlength EDIT1.TEXT: = ExcludtrailingPathDelimiter (edit2.text); ━━━━━━━━ 首 首━━━━━━━━━ 首 首 首━━━━━━━━━ (const s: string): string; platform; $ [SysUtils.pas negative function returns the last slash Description Result: = ExcludeTrailingPathDelimiter (S) reference example function SysUtils.ExcludeTrailingPathDelimiter Edit1.Text: = ExcludeTrailingBackslash (Edit2.Text); ━━━━━━━━━ ━━━━━━━━━ 首 首 The first Function LastDelimiter (Const Delimiters, S: String): Integer; $ [sysutils.PAS function Returns the location of the last separator Description LastDelimiter ('.', 'Kingron.Myetang .com ') = 16 Reference function sysutils.strscan;

Function sysutils.bytepepe example spinedit1.value: = lastdelimiter (edit1.text, edit2.text); ━━━━━━━━━ 首 首━━━━━━━━━━ 首 首━━━━━━━━━ (Const S1, S2 : integer; $ [sysutils.pas function Returns two file name description When S1> S2 return value> 0; when S1

━━━━━━━━━━━━━━━━━━━ 首 首 首 首 首 f f 首 首 首 f f; pchar; $ [sysutils.pas feature returns in pointer string STR search characters The last address of the CHR appears to support multi-byte character systems; Ansistrrscan ('Kingron.Myetang.com', ') =' .com 'refer to function sysutils.ansistrscan example edit2.text: = ANSISTRSTRSTRSTRSTRSCAN (Pchar (pchar (edit1). TEXT), '.'); ━━━━━━━━━ 首 首━━━━━━━━ 首 首 f━━━━ ((str: pchar; chr: char): PCHAR; $ [SYSUTILS.PAS function Returns the address of the first appearance of the pointer string STR search character chR The first appearance is supported by the multi-byte character system; ANSISTRSCAN ('kingron.myetang.com', '.') = '.Myetang.com' Reference function sysutils.strscan example Edit2.text: = ANSISTRSCAN (Pchar (edit1.text), '.'); ━━━━━━━━━ 首 首 首━━━━━━━━ 首 首 f━━━━ (((首 首 首 f━━━ (((((((((((((( : string; Flags: TReplaceFlags): string; the string $ [SysUtils.pas replaced Description returns the entire contents of the replacement rfReplaceAll; rfIgnoreCase ignore the case of the reference function SysUtils.AnsiUpperCase; function SysUtils.AnsiPos; function System.Copy examples // Begin StringReplace Procedure TFORM1.BUTTON1CLICK (Sender: TOBJEC T); begin memo1.lines.values ​​['[]']: = StringReplace (edit1.text, edit2.text, edit3.text, []); memo1.line.values ​​['[RFREPLACEALL]']: = StringReplace (Edit1.text, edit3.text, [rfreplace); memo1.lines.values ​​['[RFIGNORECASE]']: = StringReplace (edit1.text, edit2.text, edit3.text, [rfignoreCase]) Memo1.Lines.Values ​​['[RFREPLACEALL, RFIGNORECASE]']: = StringReplace (edit1.text, edit2.text, edit3.text, [rfreplaceAll, Rfignore]); end; /// end stringReplace ━━━━━━━ ━━━━━ ━━━━━━━ 首━━━━━━ 首 首 f━━━: (const s: string): tguid;

转载请注明原文地址:https://www.9cbs.com/read-91632.html

New Post(0)