MiniGUI API Reference (MiniGUI-Processes)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Functions
String operation helpers

Functions

MG_EXPORT char * strnchr (const char *s, size_t n, int c)
 Locates character in the first n characters of string s. More...
 
MG_EXPORT int substrlen (const char *text, int len, int delimiter, int *nr_delim)
 Locates a substring delimited by one or more delimiters in the first len characters of string text. More...
 
MG_EXPORT char * strtrimall (char *src)
 Deletes all space characters. More...
 

Detailed Description

Function Documentation

char * strnchr ( const char *  s,
size_t  n,
int  c 
)

Locates character in the first n characters of string s.

Parameters
sThe pointer to the string.
nThe number of first characters will be searched.
cThe expected character.
Returns
Returns a pointer to the first occurrence of the character c in the string s.
See also
strchr(3)
char * strtrimall ( char *  src)

Deletes all space characters.

This function deletes the blank space, form-feed('\f'), newline('\n'), carriage return('\r'), horizontal tab('\t'),and vertical tab('\v') in the head and the tail of the string.

Parameters
srcThe pointer to the string.
Returns
Returns a pointer to the string.
int substrlen ( const char *  text,
int  len,
int  delimiter,
int *  nr_delim 
)

Locates a substring delimited by one or more delimiters in the first len characters of string text.

Parameters
textThe pointer to the string.
lenThe number of first characters will be searched.
delimiterThe delimiter which delimites the substring from other.
nr_delimThe number of continuous delimiters will be returned through this pointer.
Returns
The length of the substring.
See also
strstr(3)