String Manipulation
Other versions of this page are also available for the following:
8/27/2008
String manipulation routines operate on null-terminated single-byte character and wide-character strings. Use the buffer-manipulation routines, described in Buffer Manipulation, to work with character arrays that do not end with a null character.
Generally, Windows Embedded CE supports wide-character versions of functions rather than other versions. This enables Windows Embedded CE to support Unicode while keeping the library compact.
Routine | Use |
---|---|
sprintf, swprintf |
Writes formatted data to a string. These functions have been deprecated because more secure versions are available. |
sprintf_s, swprintf_s |
Writes formatted data to a string. Security-enhanced versions of deprecated functions sprintf and swprintf. Windows Embedded CE 6.0 does not support forms of this function that use the Locale parameter, sprintf_s_l, and swprintf_s_l. |
strcat, wcscat |
Appends one string to another. These functions have been deprecated because more secure versions are available. |
strcat_s, wsccat_s |
Appends a string. Security-enhanced versions of deprecated functions strcat and wcscat. Template overload available. Windows Embedded CE 6.0 does not support the multibyte form of this function, _mbscat_s. |
strchr, wcschr |
Finds first occurrence of specified character in string |
strcmp, wcscmp |
Compares two strings |
strcpy, wcscpy |
Copies one string to another. These functions have been deprecated because more secure versions are available. |
strcpy_s, wcscpy_s |
Copies a string. Security-enhanced versions of deprecated functions strcpy and wcscpy. Buffers require NULL termination and should assert on truncation. Template overload available. Windows Embedded CE 6.0 does not support the multibyte form of this function, _mbscpy_s. |
strcspn, wcscspn |
Finds first occurrence of character from specified character set in string |
_strdup, _wcsdup |
Duplicates string |
_stricmp, _wcsicmp |
Compares two strings without regard to case |
strlen, wcslen |
Finds length of string. These functions have been deprecated because more secure versions are available. |
strnlen, wcsnlen |
Gets the length of a string, using the current locale or one that has been passed in. More secure than previous versions of strlen and wcslen. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strnlen_s_l, _mbsnlen_s, _mbsnlen_s_l and _wcsnlen_s_l. |
_strlwr, _wcslwr |
Converts string to lowercase. These functions have been deprecated because more secure versions are available. |
_strlwr_s, _wcslwr_s |
Converts a string to lowercase, using the current locale or a locale object passed in. Security-enhanced versions of deprecated function _strlwr and _wcslwr. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms of this function that use the Locale parameter, _mbslwr_s, |
strncat, wcsncat |
Appends characters of string. These functions have been deprecated because more secure versions are available. |
strncat_s, wcsncat_s |
Appends characters to a string. Security-enhanced versions of deprecated functions strncat and wcsncat. Validates parameters, template overload available. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strncat_s_l, _mbsncat_s, _mbsncat_s_l and _wcsncat_s_l. |
strncmp, wcsncmp |
Compares characters of two strings |
strncpy, wcsncpy |
Copies characters of one string to another. These functions have been deprecated because more secure versions are available. |
strncpy_s, wcsncpy_s |
Copies characters of one string to another. Security-enhanced versions of deprecated functions strncpy and wcsncpy. Template overload available. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strncpy_s_l, _mbsncpy_s, _mbsncpy_s_l and _wcsncpy_s_l. |
_strnicmp, _wcsnicmp |
Compares characters of two strings without regard to case |
_strnset, _wcsnset |
Sets first n characters of string to specified character. These functions have been deprecated because more secure versions are available. |
_strnset_s, _wcsnset_s |
Initializes characters of a string to a given character. Security-enhanced versions of deprecated functions _strnset and _wcsnet. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strnset_s_l, _mbsnset_s, _mbsnset_s_l and _wcsnset_s_l. |
strpbrk, wcspbrk |
Finds first occurrence of character from one string in another string |
strrchr, wcsrchr |
Finds last occurrence of given character in string |
_strrev, _wcsrev |
Reverses string |
_strset, _wcsset |
Sets all characters of string to specified character. These functions have been deprecated because more secure versions are available. |
_strset_s, _wcsset_s |
Sets characters of a string to a character. Security-enhanced versions of deprecated functions _strset and _wcsset. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strset_s_l, _mbsset_s, _mbsset_s_l and _wcsset_s_l. |
strspn, wcsspn |
Finds first substring from one string in another string |
strstr, wcsstr |
Finds first occurrence of specified string in another string |
strtod, wcstod |
Converts to double-precision value |
strtok, wcstok |
Finds next token in string. These functions have been deprecated because more secure versions are available. |
strtok_s, wcstok_s |
Finds the next token in a string, using the current locale or a locale passed in. Security-enhanced versions of deprecated functions strtok and wcstok. Windows Embedded CE 6.0 does not support the multibyte forms of this function or forms that use the Locale parameter, strtok_s_l, _mbstok_s, _mbstok_s_l and _wcstok_s_l. |
strtol, wcstol |
Converts to long integer value |
strtoul, wcstoul |
Converts to unsigned long integer value |
_strupr, _wcsupr |
Converts string to uppercase. These functions have been deprecated because more secure versions are available. |
_strupr_s, _wcsupr_s |
Converts a string to uppercase, using the current locale or a specified locale passed in. Security-enhanced versions of deprecated functions _strup and _wcsrup. |
See Also
Other Resources
C/C++ Libraries for Windows Embedded CE
What's New in the C Run-Time Library