Datasheet
strncpy
strpbrk
strrchr
strspn
strstr
500
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
procedure strncpy(var s1, s2 : string[100]; size : word);
Description
The function copies at most size characters from the string s2 to the string s1. If
s2 contains fewer characters than size, s1 is padded out with null characters up
to the total length of the size characters.
Prototype
function strpbrk(var s1, s2 : string[100]) : word;
Description
The function searches s1 for the first occurrence of any character from the string
s2. The null terminator is not included in the search. The function returns an
index of the matching character in
s1. If s1 contains no characters from s2, the
function returns 0xFFFF.
Prototype
function strrchr(var s : string[100]; ch : byte) : word;
Description
The function searches the string s for the last occurrence of the character ch.
The null character terminating s is not included in the search. The function
returns an index of the last ch found in
s; if no matching character was found,
the function returns 0xFFFF.
Prototype
function strspn(var s1, s2 : string[100]) : byte;
Description
The function searches the string s1 for characters not found in the s2 string.
The function returns the index of first character located in s1 that does not
match a character in
s2. If the first character in s1 does not match a character in
s2, a value of 0 is returned. If all characters in s1 are found in s2, the length of
s1 is returned (not including the terminating null character).
Prototype
function strstr(var s1, s2 : string[100]) : word;
Description
The function locates the first occurrence of the string s2 in the string s1 (exclud-
ing the terminating null character).
The function returns a number indicating the position of the first occurrence of
s2 in s1; if no string was found, the function returns 0xFFFF. If s2 is a null string,
the function returns 0.