Retrieves the length of a string.
In contrast to the Binlen function Strlen does not return the data length, but returns the number of characters before the first '\0' (null) character.
Kernel.bdh
Strlen( in sString : string ): number;
string length
Parameter | Description |
---|---|
sString | Input string |
dcltrans transaction TStrlen var sString : string; nLength : number; begin sString := "Hello world!"; write("string = "); write(sString); writeln; nLength := Strlen(sString); write("length = "); write(nLength); writeln; write("length of long string = "); write(Strlen("This is quite a long string")); writeln; end TStrlen;
string = Hello world! length = 12 length of long string = 27
WebFileUpload01.bdf