Strings
There are a small set of string functions:
CharPtrToGenericString
: This takes text as achar
character pointer and returns the same text as a genericString
object. Remember that theString
class holds values of theTCHAR
type, of which many arechar
orwchar_t
depending on system settings.Split
: This takes a string and returns a list of strings holding the space-separated words of the text.IsNumeric
: This returnstrue
if the text holds a numeric value.Trim
: This removes spaces at the beginning and at the end of the text.ReplaceAll
: This replaces one string with another string.WriteStringToStream
andReadStringFromStream
: These write and read a string to and from a stream.StartsWith
andEndsWith
: These returntrue
if the text starts or ends with the subtext.
String.h
namespace SmallWindows { extern String CharPtrToGenericString(char* text); extern vector<String> Split(String text, TCHAR c = TEXT(' ')); extern bool IsNumeric(String text); ...