StringLen
Retourne le nombre de caractères dans la chaîne.
int StringLen(
string string_value
);
|
Paramètres
string_value
[in] La chaîne de caractèresdont il faut calculer la longueur.
Valeur de Retour
Exemple :
void OnStart()
{
//--- définit la chaîne de test
string text="123456789012345";
//--- calcule le nombre de caractères dans la chaîne
int str_len=StringLen(text);
//--- affiche la chaîne de caractères et son nombre de symboles dans le journal
PrintFormat("The StringLen() function returned the value of %d chars in string: '%s'", str_len, text);
/*
Résultat
The StringLen() function returned the value of 15 chars in string: '123456789012345'
*/
}
|
Voir aussi
StringBufferLen, StringTrimLeft, StringTrimRight, StringToCharArray, StringToShortArray