utilise des strutils; [Résumé des fonctions de chaîne]
Première fonction ANSiRESEMBLESTEXT (const Atext, une autre: String): Boolean;
$ [Strutils.pas
La fonction renvoie si les deux chaînes sont similaires
Description ANSI (American National Standards Institute) American National Standards Institute;
Fonction de référence Strutils.SoundExproc;
Exemple Checkbox1.Checked: = anSireSeMlesTExt (edit1.Text, edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSICONTAINSTEXT (const Atext, ASubText: String): Boolean;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext contient une sous-chaîne ASubText
Indique insensible au cas
Fonction de référence strutils.ansiuppercase;
Exemple Checkbox1.Checked: = ansicontainStExt (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSISTARTSTEXT (const asubtext, atext: String): booléen;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext commence par une sous-chaîne ASubText
Indique insensible au cas
Fonction de référence windows.comparestring
Exemple Checkbox1.Checked: = ANSISTARSTSEXT (edit1.Text, edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIENDSTEXT (const asubtext, atext: String): booléen;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext se termine par une sous-chaîne ASubText
Indique insensible au cas
Fonction de référence windows.comparestring
Exemple Checkbox1.Checked: = anseAnDStext (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
La première fonction anSirePlaceText (const atext, afromText, atotext: string):
String;
La fonction renvoie le résultat du remplacement de la substrise afromText par une substrice atotext dans la chaîne atext
Indique insensible au cas
Fonction de référence synutils.stringreplace;
Exemple Edit4.Text: = anSirePlaceText (edit1.text, edit2.text, edit3.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIMATCHText (const Atext: String; Const Avalues: Array of
String): booléen; $ [strutils.pas
La fonction renvoie si l'atexe de chaîne est incluse dans les avals du tableau de chaîne
Indique insensible au cas
Fonction de référence strutils.ansiindextext
Exemple Checkbox1.Checked: = anSimatchText (edit1.text, ['a1', 'a2', 'a3',
'a4']);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSiIndexText (const Atext: String; Const Avalues: Array of
chaîne): entier; $ [strutils.pas
La fonction renvoie la position de la chaîne Atext dans les avals du tableau de chaîne
Indique qu'il est insensible à la casse; s'il n'est pas inclus, renvoyer -1
Fonction de référence synutils.ansisameText
Exemple Spinedit1.Value: = ANSiIndexText (Edit1.Text, ['A1', 'A2', 'A3', 'A4']);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSICONTAINSSTR (const Atext, ASubText: String): Boolean;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext contient une sous-chaîne ASubText
Description Carée sensible
Fonction de référence strutils.ansipos
Exemple Checkbox1.Checked: = ANSICONTAINSSTR (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSISTARTSSTR (const asubtext, atext: String): booléen;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext commence par une sous-chaîne ASubText
Description Carée sensible
Fonction de référence sysutils.ansisamestr
Exemple Checkbox1.Checked: = ANSistartsstr (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIENDSSTR (const asubtext, atext: String): booléen;
$ [Strutils.pas
La fonction renvoie si la chaîne Atext se termine par une sous-chaîne ASubText
Description Carée sensible
Fonction de référence sysutils.ansisamestr
Exemple Checkbox1.Checked: = anSiendsstr (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
La première fonction anSirePlacestr (const atext, afromText, atotext: string):
String;
La fonction renvoie le résultat du remplacement de la substrise afromText par une substrice atotext dans la chaîne atext
Description Carée sensible
Fonction de référence synutils.stringreplace;
Exemple Edit4.Text: = anSirePlacestr (edit1.text, edit2.text, edit3.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIMATCHSTR (const Atext: String; Const Avalues: Array of
String): booléen; $ [strutils.pas
La fonction renvoie si l'atexe de chaîne est incluse dans les avals du tableau de chaîne
Description Carée sensible
Fonction de référence strutils.ansidexstr
Exemple Checkbox1.Checked: = ANSIMATCHSTR (Edit1.Text, [«A1», «A2», «A3»,
'a4']);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSiIndexstr (const Atext: String; Const Avalues: Array of
chaîne): entier; $ [strutils.pas
La fonction renvoie la position de la chaîne Atext dans les avals du tableau de chaîne
Description Carée sensible
Fonction de référence sysutils.ansisamestr
Exemple Spinedit1.Value: = ANSiIndexstr (Edit1.Text, ['A1', 'A2', 'A3', 'A4']);
━━━━━━━━━━━━━━━━━━━━━
First Function Dupestring (const Atext: String; acont: Integer): String;
$ [Strutils.pas
La fonction renvoie les répliques de la chaîne Atext
Description Renvoie '' lorsque le compte est 0
Reportez-vous à fonction System.SetLength
Exemple edit3.text: = duPestring (edit1.text, spinedit1.value);
━━━━━━━━━━━━━━━━━━━━━
Fonction d'en-tête REVERSESTRING (const Atext: String): String;
La fonction renvoie l'ordre inverse de la chaîne Atext
Description REVERSESTRING ('1234') = '4321'
Reportez-vous à fonction System.SetLength
Exemple Edit3.Text: = ReverseString (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
First Function StuffString (const Atext: String; Astart, alngle: cardinal;
const asubtext: String): String; $ [strutils.pas
La fonction renvoie les chaînes imbriquées
Description ASTART: Position de début de nidification; ALLANGE: Longueur de nidification;
Reportez-vous à Function System.Copy
Exemple Edit3.Text: = StuffString (Edit1.Text, Spinedit1.Value, Spinedit2.Value,
Edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction randomFrom (constants constants: tableau de chaîne): String;
$ [Strutils.pas
La fonction renvoie au hasard un élément dans les avals du tableau des chaînes
Expliquez qu'il est recommandé d'exécuter randomiser avant
Système de fonction de référence.
Exemple randomisé;
━━━━━━━━━━━━━━━━━━━━━
Fonction d'en-tête ifthen (Avalue: Boolean; const atrue: String; afalse: String =
''): String;
La fonction renvoie la chaîne logique spécifiée
Ifthen (true, 'oui', 'non') = 'oui'; ifthen (false, 'oui', 'non') = 'non'
Référence <null>
Exemple Edit3.Text: = ifthen (Checkbox1.Checked, edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Fonction d'en-tête LeftStr (const Atext: String; const Account: Integer): String;
$ [Strutils.pas
La fonction renvoie les caractères acantis sur le côté gauche de la chaîne Atext
Description Letstr («123456», 3) = «123»
Reportez-vous à Function System.Copy
Exemple Edit3.Text: = LetStr (edit1.Text, Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Première fonction rightstr (const atext: string; const acount: Integer): String;
$ [Strutils.pas
La fonction renvoie les caractères acantis sur le côté droit de la chaîne Atext
Description Rightstr («123456», 3) = «456»
Reportez-vous à Function System.Copy
Exemple Edit3.Text: = Rightstr (edit1.Text, Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Première fonction midstr (const atext: string; const Astart, acont: Integer):
String;
La fonction renvoie la chaîne Atext Count Caractères à partir d'Astart
Cela signifie copier
Reportez-vous à Function System.Copy
Exemple edit3.text: = midstr (edit1.text, spinedit1.value, spinedit2.value);
━━━━━━━━━━━━━━━━━━━━━
First Fonction SearchBuf (BUF: PCHAR; BUFLEN: INTEGER; Selstart, Sellfast:
Entier;
Phar; $ [strutils.pas
La fonction renvoie la première position de pointeur recherché
Expliquer cette fonction est souvent utilisée pour rechercher des chaînes dans le texte
Référence <null>
exemple
////////// commencer SearchBuf
Fonction SearchEdit (editControl: tCustomEdit; const SearchString: String;
SearchOptions: tStringSearchOptions;
var
Tampon, p: phar;
Taille: mot;
Commencer
Résultat: = false;
if (le long (searchString) = 0) puis sortir;
Taille: = editControl.getTextlen;
if (size = 0) puis sortir;
Tampon: = stralloc (taille + 1);
essayer
EditControl.getTextBuf (tampon, taille + 1);
P: = SearchBuf (tampon, taille, editControl.SelStart, editControl.Sellngth,
SearchString, SearchOptions);
Si p <> nil alors commencez
EditControl.SeLStart: = p - tampon;
EditControl.Sellngth: = length (SearchString);
Résultat: = true;
fin;
Enfin
Strdispose (tampon);
fin;
fin;
Procédure tform1.button1Click (expéditeur: tobject);
var
SearchOptions: TStringSearchOptions;
Commencer
SearchOptions: = [];
Si Checkbox1. est venu alors
Inclure (Searchoptions, Sodown);
Si Checkbox2.Cherad a alors
Inclure (SearchOptions, Somatchcase);
Si Checkbox3.Ched a alors
Inclure (SearchOptions, Sowholeword);
SearchEdit (Memo1, edit1.Text, SearchOptions);
Memo1.setfocus;
fin;
////////// end SearchBuf
━━━━━━━━━━━━━━━━━━━━━
La première fonction sonore (const atext: string; alnglent: tSoundExLength = 4):
String;
La fonction renvoie la chaîne de détection
Explication: Selon la méthode de détection (SoundEx), vous pouvez trouver la chaîne de l'intersection;
Référence <null>
Exemple Edit2.Text: = SoundEx (edit1.Text, Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
En-tête de fonction sonorexint (const atext: string; alnglent: tSoundExintLength =
4): entier; $ [strutils.pas
La fonction renvoie l'entier de détection
Cela signifie que plus la valeur de la valeur de la longueur est élevée, plus la précision du décodage est élevée
Référence <null>
Exemple Spinedit2.Value: = SoundExint (edit1.Text, Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Fonction d'en-tête DecodeSoundExint (Avalue: entier): String;
La fonction renvoie le décodage de l'entier de sonde
Description DecodeSoundExint (SoundExint ('Hello')) est équivalent à SoundEx ('Hello')
Référence <null>
Exemple Edit2.Text: = DecodeSoundExint (Spinedit2.Value);
━━━━━━━━━━━━━━━━━━━━━
First Fonction SoundExword (constante: String): Word;
La fonction renvoie la valeur du texte de détection
Indique qu'il n'y a pas de paramètre qui a été fixé à 4
Référence <null>
Exemple Spinedit2.Value: = SoundExword (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction DecodeSoundExword (Avalue: Word): String;
La fonction renvoie le décodage de la valeur de texte de détection
Description DecodeSoundExWord (SoundExword ('Hello')) est équivalent à SoundEx ('Hello')
Référence <null>
Exemple Edit2.Text: = DecodeSoundExword (Spinedit2.Value);
━━━━━━━━━━━━━━━━━━━━━
First Function SoundExSimimar (Const atext, une autre: String; alngle:
TSoundExLength = 4): boolean;
La fonction renvoie si les chaînes de sonde des deux chaînes sont les mêmes
DESCRIPTION Résultat: = SoundEx (atext, alngle) = SoundEx (un autre, alngot)
Référence <null>
Exemple Checkbox1.Checked: = SoundExsimilar (edit1.Text, edit2.Text,
Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
First Function SoundExCompare (const Atext, un autre: String; alngle:
TSoundExLength = 4): entier;
La fonction renvoie le résultat de la comparaison de deux chaînes pour détecter les chaînes
DESCRIPTION Résultat: = ANSICOMCARESTR (SONonEx (Atext, Alength), SoundEx (un autre,
Alngle))
Fonction de référence sysutils.SansicaCarestr
Exemple Spinedit2.Value: = SoundExCompare (edit1.text, edit2.text,
Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
First Function SoundExproc (const Atext, une autre: String): booléen;
$ [Strutils.pas
Fonction Call SoundExsimilaire pour retourner les chaînes de sonde des deux chaînes.
Description de la valeur par défaut de la variable système ANSiRESEMBLESPROC
Fonction de référence strutils.ansiresemblesText
Exemple [var anSireseMblesProc: tCompareTextProc = SoundExProc;]
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête NewsTr (const S: String): PString;
La fonction renvoie une nouvelle adresse de pointeur de chaîne
Description Retour nullstr lorsque la chaîne s est vide
Reportez-vous au système de procédure.
exemple
///////////// Begin Newstr, Disposstrue
Procédure tform1.button1Click (expéditeur: tobject);
var
P: PString;
Commencer
P: = newstr (edit1.text);
Edit2.text: = p ^;
Disposer (P);
fin;
///////////// End Newstr, Disposest
━━━━━━━━━━━━━━━━━━━━━
Première procédure Dispostrage (P: PString);
Fonction Release String Pointer P Resource
Description Utilisation avec newtr
Reporter à la procédure Système.
Exemple <voir ci-dessus, voir ci-dessous>
━━━━━━━━━━━━━━━━━━━━━
Première procédure Attributestr (var p: pString; const S: String);
$ [Synutils.pas
La fonction met à jour la chaîne S pour chaîner pointeur P
Description Ressources qui étaient auparavant des pointeurs de chaînes publiées lors de la mise à jour des valeurs
Fonction de référence synutils.newstr; fonction sysutils.disposestr
exemple
///////////// Begin Assignstr
Procédure tform1.button1Click (expéditeur: tobject);
var
P: PString;
Commencer
P: = nil;
Assignstr (p, edit1.text);
Edit2.text: = p ^;
Disposer (P);
fin;
///////////// End Assignstr
━━━━━━━━━━━━━━━━━━━━━
Première procédure A SPENDSTR (VAR DEST: String; const S: String);
$ [Synutils.pas
Fonction Apprend String s After String dest
La description est équivalente à Dest: = dest + S;
Référence <null>
exemple
///////////// commencer A SPENDSTR
Procédure tform1.button1Click (expéditeur: tobject);
var
S: String;
Commencer
S: = Edit2.Text;
A SPENDSTR (S, Edit1.Text);
Edit2.text: = s;
fin;
//////////// End A SPENDSTR
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête
La fonction renvoie la forme de capital de la chaîne S
Indique que les caractères non-laideur ne sont pas traités
Reportez-vous à Procedure System.SetLength
Exemple edit2.text: = uppercase (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
First Fonction minuscule (const S: String): String;
La fonction renvoie la forme minuscule de la chaîne S
Indique que les caractères non capapulaires ne sont pas traités
Reportez-vous à Procedure System.SetLength
Exemple Edit2.Text: = minuscules (Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête Comparestr (const S1, S2: String): entier;
La fonction revient pour comparer deux caractères
Description lorsque S1> S2 renvoie la valeur> 0;
Référence <null>
Exemple Spinedit1.Value: = Comparrestr (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
First Fonction Comparmem (P1, P2: pointeur; longueur: entier): booléen;
assembleur; $ [sysutils.pas
Fonction Retour comparaison de deux pointeurs de mémoire
Description CompareMem (pChar («12a»), pChar («12c»), 2) = true; Comparmem (phar («12a»),
PChar ('12c'), 3) = false
Référence <null>
Exemple Checkbox1.Checked: = Comparmem (self, form1, 8);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête Comparentext (const S1, S2: String): entier; $ [sysUtils.pas
La fonction revient pour comparer deux chaînes
Indique insensible au cas
Référence <null>
Exemple Spinedit1.Value: = Comparetext (edit1.Text, edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête SAMEText (const S1, S2: String): Boolean;
La fonction renvoie si deux chaînes sont égales
Indique insensible au cas
Référence <null>
Exemple Checkbox1.Checked: = sameText (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIUPPERCASE (const S: String): String;
La fonction renvoie la forme de capital de la chaîne S
Description ANSI (American National Standards Institute) American National Standards Institute;
Fonction de référence Windows.Charupperbuff
Exemple Edit2.Text: = ANSIUPPERCASE (Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSILOWERCASE (const S: String): String;
La fonction renvoie la forme minuscule de la chaîne S
Indique que les caractères non capapulaires ne sont pas traités
Fonction de référence Windows.Charlowerbuff
Exemple Edit2.Text: = ANSILOWERCASE (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de l'en-tête ANSICOMPARELT (const S1, S2: String): entier;
Fonction Comparaison inverse de deux chaînes
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestring
Exemple Spinedit1.Value: = ANSICOMOMPARELT (Edit1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête ANSISAMELTR (const S1, S2: String): Boolean;
La fonction renvoie si deux chaînes sont égales
Description Carée sensible
Fonction de référence sysutils.SansicaCarestr
Exemple Checkbox1.Checked: = ANSISAMESTR (edit1.Text, edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de l'en-tête ANSICOMCARETEXT (const S1, S2: String): entier;
Fonction Comparaison inverse de deux chaînes
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestring
Exemple Spinedit1.Value: = ANSICOMCARETEXT (EDIT1.Text, Edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de l'en-tête ANSISAMEText (const S1, S2: String): Boolean;
La fonction renvoie si deux chaînes sont égales
Indique insensible au cas
Fonction de référence synutils.SanCareText
Exemple Checkbox1.Checked: = ANSISAMEText (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête ANSistComp (S1, S2: PCHA): entier;
La fonction revient pour comparer deux chaînes de pointeur
Description lorsque S1> S2 renvoie la valeur> 0;
Système de fonction de référence.Charestring
Exemple Spinedit1.Value: = ANSistComp (PCHA (Edit1.Text), PCHA (EDIT2.Text))
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête ANSistRICOM (S1, S2: PHAR): entier;
La fonction revient pour comparer deux chaînes de pointeur
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestring
Exemple Spinedit1.Value: = ANSistRIComp (PCHA (Edit1.Text), PCHA (Edit2.Text))
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSistlComp (S1, S2: PCHINE; Maxlen: Cardinal): entier;
$ [Synutils.pas
Fonction retour pour comparer deux chaînes de pointeur spécifiées longueur
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestring
Exemple Spinedit1.Value: = ANSistlComp (PCHA (Edit1.Text), PCHA (Edit2.Text),
Spinedit2.Value)
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSistlicomp (S1, S2: PCHAR; Maxlen: Cardinal): entier;
$ [Synutils.pas
Fonction retour pour comparer deux chaînes de pointeur spécifiées longueur
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestring
Exemple Spinedit1.Value: = ANSistlicomp (PCHA (Edit1.Text), PCHA (Edit2.Text),
Spinedit2.Value)
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête ANSistlower (STR: PCHA): PCHER; $ [sysutils.pas
La fonction renvoie la chaîne du pointeur en minuscules
Indique que les caractères non capapulaires ne sont pas traités
Fonction de référence Windows.Charlower
Exemple Edit2.Text: = ANSistlower (PCHA (EDIT1.Text));
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête ANSistrupper (STR: PCHA): PCHER; $ [sysutils.pas
Fonction Renvoie le pointeur Capitalisation de la chaîne
Indique que les caractères non-laideur ne sont pas traités
Fonction de référence Windows.Charupper
Exemple Edit2.Text: = ANSistrupper (PCHA (EDIT1.Text));
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSILASTCHAR (const S: String): PCHINE;
La fonction renvoie le dernier caractère de pointeur de la chaîne S
Description Lorsque la chaîne S est une chaîne vide, un pointeur nul est renvoyé.
Fonction de référence synutils.bytetype
Exemple Edit2.Text: = ANSILASTCHAR (Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête ANSistlastChar (P: PCHA): PCHA
La fonction renvoie le dernier caractère de pointeur de la chaîne du pointeur P
Description Lorsque la chaîne P est un pointeur vide, il renvoie un pointeur vide.
Fonction de référence synutils.bytetype
Exemple Edit2.Text: = ANSILASTCHAR (PHAR (EDIT1.Text));
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête large (const s: welestring): largement; $ [sysutils.pas
La fonction renvoie la capitalisation d'une chaîne à deux octets
Description Caractères WidEchar Double-Byte
Fonction de référence Windows.Charupperbuffw
Exemple edit2.text: = wideuppercase (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction WidelowerCase (const S: Welsestring): Welsestring; $ [sysUtils.pas
La fonction renvoie la forme minuscule d'une chaîne à deux octets
Cela signifie pourquoi je ne peux pas le tester
Fonction de référence Windows.Charlowerbuffw
Exemple Edit2.Text: = WidelowerCase (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction widecomparestr (const S1, S2: Widestring): entier;
$ [Synutils.pas
Comparaison de retour de fonction de deux chaînes de double octet
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestringw
Exemple Spinedit1.Value: = wideComparestr (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction WideAmstr (const S1, S2: Welstring): Boolean;
La fonction renvoie si deux cordes à deux octets sont les mêmes
Description Carée sensible
Fonction de référence sysutils.wideComparestr
Exemple Checkbox1.Checked: = wideAmstr (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction widECompareText (const S1, S2: Widestring): entier;
$ [Synutils.pas
Comparaison de retour de fonction de deux chaînes de double octet
Description lorsque S1> S2 renvoie la valeur> 0;
Fonction de référence windows.comparestringw
Exemple Spinedit1.Value: = widECompareText (edit1.Text, edit2.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction widesAmEText (const S1, S2: Widestring): booléen;
$ [Synutils.pas
La fonction renvoie si deux cordes à deux octets sont les mêmes
Indique insensible au cas
Fonction de référence synutils.wideCompareText
Exemple Checkbox1.Checked: = wideAmEText (edit1.text, edit2.text);
━━━━━━━━━━━━━━━━━━━━━
TRAPE DE FONCTIONNEMENTS DE L'ENSEMENT (CONST S: String): String;
Première fonction de fonction (const s: welestring): welstring;
$ [Synutils.pas
La fonction revient pour supprimer les caractères gauche et droit de la chaîne S
Les caractères qui indiquent que moins de # 32 sont considérés comme des caractères invisibles
Reportez-vous à Function System.Copy
Exemple Edit2.Text: = TRIM (Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de l'en-tête trimleft (const S: String): String;
Première fonction trimleft (const s: welestring): welestring;
$ [Synutils.pas
Fonction Retour pour supprimer les caractères invisibles à gauche de la chaîne S
Les caractères qui indiquent que moins de # 32 sont considérés comme des caractères invisibles
Reportez-vous à Function System.Copy
Exemple edit2.text: = trimbleft (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
Fonction de l'en-tête TrimRight (const S: String): String;
Première fonction TrimRight (const S: Welsestring): Welsestring;
$ [Synutils.pas
Fonction Retour pour supprimer les caractères invisibles à droite de la chaîne S
Les caractères qui indiquent que moins de # 32 sont considérés comme des caractères invisibles
Reportez-vous à Function System.Copy
Exemple Edit2.Text: = TrimRight (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête citée (const S: String): String;
La fonction renvoie l'expression de la chaîne S dans Pascal
Explication: Une seule citation dans une seule citation sera convertie en deux
Reportez-vous à Procedure System.insert
Exemple Edit2.Text: = Curedstr (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction anseicotedStr (const s: string; quote: char): String;
$ [Synutils.pas
La fonction renvoie l'expression de la chaîne S avec la citation de caractères comme citations
Description ANSIQUOTEDSTR («Hello« World »,
'@') = '@ Hello "world @'; ansiquotedstr ('Hello" world', '"') = '" Hello "" World "'
Fonction de référence synutils.ansistrscan
Exemple Edit2.Text: = ANSIQUOTEDST (Edit1.Text, '"');
━━━━━━━━━━━━━━━━━━━━━
Première fonction ANSIEXTRATTQUODEDSTR (VAR SRC: PCHAR; QUOTE: CHAR): String;
$ [Synutils.pas
La fonction renvoie la forme originale de la citation de caractère comme citations
Cela signifie que SRC reste inchangé lorsque l'expression est illégale.
Fonction de référence synutils.ansistrscan
exemple
/////////// commencer ANSIEXTRATQUODEDSTR
Procédure tform1.button1Click (expéditeur: tobject);
var
P: PCHA;
Commencer
P: = pChar (edit1.text);
Edit2.text: = ANSIEXTRATQUOTEDSTR (P, '"');
Edit3.text: = p;
fin;
////////// End AnsiextractQuotedstr
━━━━━━━━━━━━━━━━━━━━━
Première fonction anidequotedStr (const s: string; aquote: char): String;
$ [Synutils.pas
La fonction renvoie la forme originale du personnage aquote comme citations
Lorsque l'expression est illégale, elle renvoie s
Fonction de référence synutils.SansiextractQuotedstr
Exemple edit2.text: = anidequotedstr (edit1.text, '"');
━━━━━━━━━━━━━━━━━━━━━
First Fonction ajustipinebreaks (const S: String; Style: ttextLinebreakStyle =
{$ Ifdef linux} tlbSlf {$ endif} {$ ifdef mswindows} tlbscrlf {$ endif}):
chaîne;
La fonction revient pour ajuster le séparateur de ligne de la chaîne donnée à une séquence CR / LF
illustrer
AjustementBreaks ('1' # 13'2 '# 13) =' 1 '# 13 # 10'2' # 13 # 10; ajustementbreaks ('1' # 10'2 '# 10) =' 1 '# 13 # 10 '2' # 13 # 10
Fonction de référence sysutils.strnextchar
Exemple <NULL>
━━━━━━━━━━━━━━━━━━━━━
Fonction de tête ISVALIDIDENT (const Identi: String): Boolean;
La fonction renvoie si la chaîne Identif est l'identifiant correct
Description Identifier :: Lettres | Soulignez [lettres | sous-lines | Numbers] ...
Référence <null>
Exemple Checkbox1.Checked: = isValiDident (edit1.text);
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête InttoStr (valeur: entier): String;
Fonction en tête InttoStr (valeur: int64): String;
La fonction renvoie la valeur entière à convertir en chaîne
DESCRIPTION FORMAT ('% D', [valeur])
Fonction de référence synutils.fmtstr
Exemple Edit2.Text: = intToStr (Spinedit1.Value);
━━━━━━━━━━━━━━━━━━━━━
Première fonction intohex (valeur: entier; chiffres: entier): string;
$ [Synutils.pas
Première fonction intohex (valeur: int64; chiffres: entier): String;
$ [Synutils.pas
La fonction renvoie la valeur entière convertie en résultats de performance hexadécimaux;
Description Les chiffres des paramètres spécifient la largeur minimale du caractère; si la largeur minimale est insuffisante, elle sera remplie de 0.
Fonction de référence synutils.fmtstr
Exemple Edit2.Text: = intoHex (Spinedit1.Value, Spinedit2.Value);
━━━━━━━━━━━━━━━━━━━━━
Fonction d'en-tête StrToint (const S: String): entier; $ [sysUtils.pas
La fonction renvoie la chaîne S pour la convertir en un entier
Explication: Une exception sera causée lorsqu'une chaîne est exprimée par non-intégrale
Reportez-vous à Procedure System.Val
Exemple Spinedit1.Value: = strToint (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction strTointDef (const s: string; par défaut: entier): entier;
$ [Synutils.pas
La fonction renvoie la chaîne S pour la convertir en un entier
La valeur par défaut est renvoyée lorsque la chaîne est exprimée par non-intégrale.
Reportez-vous à Procedure System.Val
Exemple Spinedit1.Value: = strTointDef (edit1.Text, 0);
━━━━━━━━━━━━━━━━━━━━━
Première fonction trystrToint (const s: string; out valeur: entier): booléen;
$ [Synutils.pas
La fonction renvoie si la chaîne S est convertie en valeur entière avec succès
Description false est renvoyée lorsque la chaîne est exprimée par non-entereuse et que la valeur sera publiée comme 0
Reportez-vous à Procedure System.Val
exemple
/////////// commencer Trystrtoint
Procédure tform1.button1Click (expéditeur: tobject);
var
I: entier;
Commencer
Checkbox1.checked: = trystrToint (edit1.text, i);
Spinedit1.Value: = i;
fin;
////////// End TrystrToint
━━━━━━━━━━━━━━━━━━━━━
Fonction en tête StrToint64 (const S: String): int64;
La fonction renvoie la chaîne S pour la convertir en un entier de soixante-quatre bits
Explication: Une exception sera causée lorsqu'une chaîne est exprimée par un entier non 64 bits.
Reportez-vous à Procedure System.Val
Exemple Spinedit1.Value: = strToint64 (edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
Première fonction strToint64Def (const S: String; const default: int64): int64;
$ [Synutils.pas
La fonction renvoie la chaîne S pour la convertir en un entier de soixante-quatre bits
La valeur par défaut est renvoyée lorsque la chaîne est exprimée par entier non 64 bits.
Reportez-vous à Procedure System.Val
Exemple Spinedit1.Value: = strToint64Def (edit1.Text, 0);
━━━━━━━━━━━━━━━━━━━━━
Première fonction trystrtOut64 (const s: string; out valeur: int64): booléen;
$ [Synutils.pas
La fonction renvoie si la chaîne S est convertie en une valeur entière de soixante-quatre bits avec succès
Description false est renvoyée lorsque la chaîne est exprimée par un entier non au four à quatre et quatre et la valeur sera publiée comme 0
Reportez-vous à Procedure System.Val
exemple
////////// commencer TrystrtOut64
Procédure tform1.button1Click (expéditeur: tobject);
var
I: Int64;
Commencer
Checkbox1.Checked: = trystrtoint64 (edit1.text, i);
Spinedit1.Value: = i;
fin;
////////// End TrystrtOut64
━━━━━━━━━━━━━━━━━━━━━
Première fonction Strtobool (const S: String): Boolean;
La fonction renvoie la chaîne S pour la convertir en valeur logique
Le caractère d'explication provoquera des exceptions lorsqu'elle ne sera pas logiquement exprimée
Fonction de référence synutils.trystrtobool
例子CheckBox1.Checked := StrToBool(Edit1.Text);
━━━━━━━━━━━━━━━━━━━━━
首部function StrToBoolDef(const S: string; const Default: Boolean):
Boolean; $[SysUtils.pas
功能返回字符串S转换成逻辑值
说明字符非逻辑表达时则返回默认值Default
参考function SysUtils.TryStrToBool
例子CheckBox1.Checked := StrToBoolDef(Edit1.Text, False);
━━━━━━━━━━━━━━━━━━━━━
首部function TryStrToBool(const S: string; out Value: Boolean): Boolean;
$[SysUtils.pas
功能返回字符串S转换成逻辑值Value是否成功
说明[注意]0为假非0为真;不是'True'和'False';Delphi6 Bug 如下修正
参考function SysUtils.AnsiSameText;var SysUtils.TrueBoolStrs;var
SysUtils.FalseBoolStrs
exemple
///////Begin TryStrToBool
Procédure tform1.button1Click (expéditeur: tobject);
var
B: Boolean;
Commencer
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;
fin;
///////End TryStrToBool
Ci-joint
///////Begin TryStrToBool
function TryStrToBool(const S: string; out Value: Boolean): Boolean;
function CompareWith(const aArray: array of string): Boolean;
var
I: Integer;
Commencer
Result := False;
for I := Low(aArray) to High(aArray) do
if AnsiSameText(S, aArray[I]) then
Commencer
Result := True;
Casser;
fin;
fin;
var
LResult: Extended;
Commencer
Result := TryStrToFloat(S, LResult);
if Result then
Value := LResult <> 0
autre
Commencer
Result := True; //修正处
VerifyBoolStrArray;
if CompareWith(TrueBoolStrs) then
Value := True
else if CompareWith(FalseBoolStrs) then
Value := False
autre
Result := False;
fin;
fin;
///////End TryStrToBool
━━━━━━━━━━━━━━━━━━━━━
首部function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string;
$[SysUtils.pas
功能返回逻辑值B转换成字符串
说明BoolToStr(False, False)='0';BoolToStr(False, True)='-1'
参考var SysUtils.TrueBoolStrs;var SysUtils.FalseBoolStrs
例子Edit1.Text := BoolToStr(CheckBox1.Checked, CheckBox2.Checked);
━━━━━━━━━━━━━━━━━━━━━
首部function LoadStr(Ident: Integer): string; $[SysUtils.pas
功能返回根据标识Ident的字符串资源
说明字符串资源是指程序的内部资源
参考function SysUtils.FindStringResource
例子Edit2.Text := LoadStr(StrToIntDef(Edit1.Text, 0));
━━━━━━━━━━━━━━━━━━━━━
首部function FmtLoadStr(Ident: Integer; const Args: array of const):
string; $[SysUtils.pas
功能返回格式化的字符串资源
说明字符串资源是指程序的内部资源
参考function SysUtils.FmtStr;function SysUtils.FindStringResource
例子<NULL>;
━━━━━━━━━━━━━━━━━━━━━
首部function StrLen(const Str: PChar): Cardinal; $[SysUtils.pas
功能返回指针字符串的长度
说明当指针字符串Str为nil时将触发异常
参考<NULL>
例子SpinEdit2.Value := StrLen(PChar(Edit1.Text));
━━━━━━━━━━━━━━━━━━━━━
首部function StrEnd(const Str: PChar): PChar; $[SysUtils.pas
功能返回指针字符串的结尾
说明当指针字符串Str为nil时将触发异常
参考<NULL>
例子Edit2.Text := StrEnd(PChar(Edit1.Text)) - SpinEdit1.Value;
━━━━━━━━━━━━━━━━━━━━━
首部function StrMove(Dest: PChar; const Source: PChar; Count: Cardinal):
PChar; $[SysUtils.pas
功能返回将指针字符串Source指定内存数量Count复制覆盖到指针字符串Dest中
说明Dest没有分配资源将触发异常s
参考function System.Move
exemple
///////Begin StrMove
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: PChar;
Commencer
vBuffer := '0123456789';
StrMove(vBuffer, PChar(Edit1.Text), SpinEdit1.Value);
Edit2.Text := vBuffer;
fin;
///////End StrMove
━━━━━━━━━━━━━━━━━━━━━
首部function StrCopy(Dest: PChar; const Source: PChar): PChar;
$[SysUtils.pas
功能返回将指针字符串Source复制到指针字符串Dest中
说明Dest应已经分配足够的空间非则将触发异常
参考<NULL>
exemple
///////Begin StrCopy
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: PChar;
Commencer
GetMem(vBuffer, Length(Edit1.Text) + 1);
StrCopy(vBuffer, PChar(Edit1.Text));
Edit2.Text := vBuffer;
FreeMem(vBuffer);
fin;
///////End StrCopy
━━━━━━━━━━━━━━━━━━━━━
首部function StrECopy(Dest:PChar; const Source: PChar): PChar;
$[SysUtils.pas
功能返回将指针字符串Source复制到指针字符串Dest中的结尾
说明可以连接指针字符串
参考<NULL>
exemple
///////Begin StrECopy
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrECopy(StrECopy(vBuffer, PChar(Edit1.Text)), PChar(Edit2.Text));
Edit3.Text := vBuffer;
fin;
///////End StrECopy
━━━━━━━━━━━━━━━━━━━━━
首部function StrLCopy(Dest: PChar; const Source: PChar; MaxLen: Cardinal):
PChar; $[SysUtils.pas
功能返回将指针字符串Source指定长度MaxLen复制到指针字符串Dest中
说明Dest应已经分配足够的空间非则将触发异常
参考<NULL>
exemple
///////Begin StrLCopy
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrLCopy(vBuffer, PChar(Edit1.Text), SpinEdit1.Value);
Edit2.Text := vBuffer;
fin;
///////End StrLCopy
━━━━━━━━━━━━━━━━━━━━━
首部function StrPCopy(Dest: PChar; const Source: string): PChar;
$[SysUtils.pas
功能返回将指针字符串Source复制到指针字符串Dest中
说明StrLCopy(Dest, PChar(Source), Length(Source))
参考function SysUtils.StrLCopy
exemple
///////Begin StrPCopy
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrPCopy(vBuffer, PChar(Edit1.Text));
Edit2.Text := vBuffer;
fin;
///////End StrPCopy
━━━━━━━━━━━━━━━━━━━━━
首部function StrPLCopy(Dest: PChar; const Source: string; MaxLen:
Cardinal): PChar; $[SysUtils.pas
功能返回将字符串Source指定长度MaxLen复制到指针字符串Dest中
说明StrLCopy(Dest, PChar(Source), MaxLen)
参考function SysUtils.StrLCopy
exemple
///////Begin StrPLCopy
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrPLCopy(vBuffer, Edit1.Text, SpinEdit1.Value);
Edit2.Text := vBuffer;
fin;
///////End StrPLCopy
━━━━━━━━━━━━━━━━━━━━━
首部function StrCat(Dest: PChar; const Source: PChar): PChar;
$[SysUtils.pas
功能返回连接指针字符串Dest和指针字符串Source
说明StrCopy(StrEnd(Dest), Source)
参考function SysUntils.StrCopy
exemple
///////Begin StrCat
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrPCopy(vBuffer, Edit1.Text);
StrCat(vBuffer, PChar(Edit2.Text));
Edit3.Text := vBuffer;
fin;
///////End StrCat
━━━━━━━━━━━━━━━━━━━━━
首部function StrLCat(Dest: PChar; const Source: PChar; MaxLen: Cardinal):
PChar; $[SysUtils.pas
功能返回连接指针字符串Dest和指针字符串Source
说明[注意]MaxLen指定连接后的最大长度不是指针字符串Source的长度
参考<NULL>
exemple
///////Begin StrLCat
Procédure tform1.button1Click (expéditeur: tobject);
var
vBuffer: array[0..255] of Char;
Commencer
StrPCopy(vBuffer, Edit1.Text);
StrLCat(vBuffer, PChar(Edit2.Text), SpinEdit1.Value);
Edit3.Text := vBuffer;
fin;
///////End StrLCat
━━━━━━━━━━━━━━━━━━━━━
首部function StrComp(const Str1, Str2: PChar): Integer; $[SysUtils.pas
功能返回比较两个指针字符串
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部function StrIComp(const Str1, Str2: PChar): Integer; $[SysUtils.pas
功能返回比较两个指针字符串
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrIComp(PChar(Edit1.Text), PChar(Edit2.Text));
━━━━━━━━━━━━━━━━━━━━━
首部function StrLComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能返回比较两个指针字符串指定长度
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;区分大小写;Length(长度);[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrLComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部function StrLIComp(const Str1, Str2: PChar; MaxLen: Cardinal): Integer;
$[SysUtils.pas
功能返回比较两个指针字符串指定长度
说明当S1>S2返回值>0;当S1<S2返回值<0;当S1=S2返回值=0;不区分大小写;[注意]返回第一个出现不同字符的差异
参考<NULL>
例子SpinEdit1.Value := StrLIComp(PChar(Edit1.Text), PChar(Edit2.Text),
SpinEdit2.Value)
━━━━━━━━━━━━━━━━━━━━━
首部function StrScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能返回在指针字符串Str搜索字符Chr第一个出现的地址
说明没有找到则返回空指针
参考<NULL>
例子Edit2.Text := StrScan(PChar(Edit1.Text), '*');
━━━━━━━━━━━━━━━━━━━━━
首部function StrRScan(const Str: PChar; Chr: Char): PChar; $[SysUtils.pas
功能返回在指针字符串Str搜索字符Chr最后一个出现的地址
说明没有找到则返回空指针
参考<NULL>
例子Edit2.Text := StrRScan(PChar(Edit1.Text), '*');
━━━━━━━━━━━━━━━━━━━━━
首部function StrPos(const Str1, Str2: PChar): PChar; $[SysUtils.pas
功能返回指针字符串Str2在Str1中第一个出现的地址
说明没有找到则返回空指针;StrPos('12345', '3') = '345'
参考<NULL>
例子Edit3.Text := StrPos(PChar(Edit1.Text), PChar(