Home >Common Problem >What is the end of string flag?
The string end mark is "\0", and 0 is the ASCII code representation of "\0", which is the first ASCII code. The ASCII code of the number 0 is 48, so you need to use " /0" ends.
#'\0' is the end mark of the string array.
And 0 is the ASCII code representation of '\0', which is the first ASCII code. The ASCII code of the number 0 is 48, so when writing a program, you must end it with '\0', such as char a[3 ] = {'h','i','\0'}, or directly char a[] = "hi", the compiler will think it is a string array and ends with '\0'.
When debugging the program, you can see that there is 0 in the memory. This is the representation of the ASCII code and can also be regarded as an unsigned int
type.
Application reference of strings:
1. Concatenation operation concat(s1,s2,s3…sn)
is equivalent to s1 s2 s3…sn.
Example: concat('11','aa')='11aa';
2. Find the substring. Copy(s,I,I)
Extract a substring of length l starting from the I-th character from the string s.
Example: copy(‘abdag’,2,3)=’bda’
3. Delete the substring. The procedure Delete(s,I,l) deletes the substring of length l starting from the I-th character from the string s.
Example:s:=’abcde’;delete(s,2,3);
Results:=’ae’
The above is the detailed content of What is the end of string flag?. For more information, please follow other related articles on the PHP Chinese website!