Class string |
Introduction no help | string Class Referencestring class more... Public Member Functions
Detailed DescriptionConversion from/to int/double is done implicit. Member Documentationbool string::contains(string str)contain a string Returns:true if the string contains the string str. Otherwise false.string string::left(int i)left Returns:the left i char of the stringint string::length()length Returns:length of the string (same as size)string string::mid(int i, int k=-1)mid of string Returns:length a path of the string starting at position i with the length k.The rest of the string starting at position i is returned if k is -1 or missing. string string::setNum(int i)set number Set the string to the number i string string::setNum(double d, int k)set number Set the string to the number d with precision of k void string::toInt()convert to integer The string is converted to a integer. void string::toDouble()convert to double The string is converted to a double. int string::size()size Returns:length of the string (same as length)string string::setDateTime(string format)set date and time Set the string to the current date and time. With the string format the format can be set. Without the string the date is set to local setup.
string string::setTime(string format)set time Set the string to the current time. With the string format the format can be set. Without the string the date is set to local setup. setDateTime for possible formats string string::setDate(string format)set date Set the string to the current date. With the string format the format can be set. Without the string the date is set to local setup. setDateTime for possible formats int string::indexOf(string str, int index)index of Returns the index position of the first occurrence of the string str in this string, searching forward from index position from. Returns -1 if str is not found. int string::lastIndexOf(string str, int index)index of Returns the index position of the last occurrence of the string str in this string, searching backward from index position from. If from is -1, the search starts at the last character; if from is -2, at the next to last character and so on. Returns -1 if str is not found. string string::remove(string str)remove Remove all str from the string. The removement is case sensitive. string string::replace(string macht,string with)replace All existing strings match is replaced with with. The replacement is case sensitive. string string::parameter(string str)parameter Returns:the parameter str.Example:
string s="type=2 width=4 length=6"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
© 2008 Jürgen Thies