Home Search Forums Register Forum Rules Man Pages FAQ Members Search Today's Posts Mark Forums Read

# RedHat 9 (Linux i386) - man page for qstring (redhat section 3qt)

Linux & Unix Commands - Search Man Pages
 Man Page or Keyword Search: man All Sections 1 - General Commands 1m - System Admin 2 - System Calls 3 - Subroutines 4 - Special Files 5 - File Formats 6 - Games 7 - Macros and Conventions 8 - Maintenance Commands 9 - Kernel Interface N - New Commands Select Man Page Set:       Linux 2.6 RedHat 9 (Linux i386) Debian 7.7 SuSE 11.3 CentOS 7.0 SunOS 5.10 OpenSolaris 2009.06 BSD 2.11 FreeBSD 11.0 NetBSD 6.1.5 OSX 10.6.2 OpenDarwin 7.2.1 ULTRIX 4.2 PHP 5.6 Minix 2.0 Plan 9 Unix Version 7 OSF1 5.1 (alpha) POSIX 1003.1 X11R7.4 XFree86 4.7.0 all unix.com man page sets apropos Keyword Search (sections above)

 QString(3qt) QString(3qt) NAME QString - Abstraction of Unicode text and the classic C '\0'-terminated char array SYNOPSIS All the functions in this class are reentrant when Qt is built with thread support.

With 'e', 'E', and 'f', prec is the number of digits after the decimal point. With 'g' and 'G', prec is the maximum number of significant digits (trailing zeroes are omitted). double d = 12.34; QString ds = QString( "'E' format, precision 3, gives %1" ) .arg( d, 0, 'E', 3 ); // ds == "1.234E+001" See also setNum(). QString::operator const char * () const Returns latin1(). Be sure to see the warnings documented in the latin1() function. Note that for new code which you wish to be strictly Unicode-clean, you can define the macro QT_NO_ASCII_CAST when compiling your code to hide this function so that automatic casts are not done. This has the added advantage that you catch the programming error described in operator!(). QString::operator std::string () const Returns ascii(). bool QString::operator! () const Returns TRUE if this is a null string; otherwise returns FALSE. QString name = getName(); if ( !name ) name = "Rodney"; Note that if you say QString name = getName(); if ( name ) doSomethingWith(name); It will call "operator const char*()", which is inefficent; you may wish to define the macro QT_NO_ASCII_CAST when writing code which you wish to remain Unicode-clean. When you want the above semantics, use: QString name = getName(); if ( !name.isNull() ) doSomethingWith(name); See also isEmpty(). QString &; QString::operator+= ( const QString & str ) Appends str to the string and returns a reference to the string. QString &; QString::operator+= ( const QByteArray & str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Appends str to the string and returns a reference to the string. QString &; QString::operator+= ( const char * str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Appends str to the string and returns a reference to the string. QString &; QString::operator+= ( const std::string & str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Appends str to the string and returns a reference to the string. QString &; QString::operator+= ( QChar c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Appends c to the string and returns a reference to the string. QString &; QString::operator+= ( char c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Appends c to the string and returns a reference to the string. QString &; QString::operator= ( QChar c ) Sets the string to contain just the single character c. QString &; QString::operator= ( const QString & s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Assigns a shallow copy of s to this string and returns a reference to this string. This is very fast because the string isn't actually copied. QString &; QString::operator= ( const char * str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Assigns a deep copy of str, interpreted as a classic C string to this string and returns a reference to this string. If str is 0, then a null string is created. See also isNull(). QString &; QString::operator= ( const std::string & s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Makes a deep copy of s and returns a reference to the deep copy. QString &; QString::operator= ( const QCString & cs ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Assigns a deep copy of cs, interpreted as a classic C string, to this string and returns a reference to this string. QString &; QString::operator= ( char c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to contain just the single character c. QChar QString::operator[] ( int i ) const Returns the character at index i, or QChar::null if i is beyond the length of the string. If the QString is not const (i.e., const QString) or const& (i.e., const QString&), then the non-const overload of operator[] will be used instead. QCharRef QString::operator[] ( int i ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. The function returns a reference to the character at index i. The resulting reference can then be assigned to, or used immediately, but it will become invalid once further modifications are made to the original string. If i is beyond the length of the string then the string is expanded with QChar::nulls, so that the QCharRef references a valid (null) character in the string. The QCharRef internal class can be used much like a constant QChar, but if you assign to it, you change the original string (which will detach itself because of QString's copy-on- write semantics). You will get compilation errors if you try to use the result as anything but a QChar. QString &; QString::prepend ( const QString & s ) Inserts s at the beginning of the string and returns a reference to the string. Equivalent to insert(0, s). QString string = "42"; string.prepend( "The answer is " ); // string == "The answer is 42" See also insert(). QString &; QString::prepend ( char ch ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Inserts ch at the beginning of the string and returns a reference to the string. Equivalent to insert(0, ch). See also insert(). QString &; QString::prepend ( QChar ch ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Inserts ch at the beginning of the string and returns a reference to the string. Equivalent to insert(0, ch). See also insert(). QString &; QString::prepend ( const QByteArray & s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Inserts s at the beginning of the string and returns a reference to the string. Equivalent to insert(0, s). See also insert(). QString &; QString::prepend ( const char * s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Inserts s at the beginning of the string and returns a reference to the string. Equivalent to insert(0, s). See also insert(). QString &; QString::prepend ( const std::string & s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Inserts s at the beginning of the string and returns a reference to the string. Equivalent to insert(0, s). See also insert(). QChar &; QString::ref ( uint i ) Returns the QChar at index i by reference, expanding the string with QChar::null if necessary. The resulting reference can be assigned to, or otherwise used immediately, but becomes invalid once furher modifications are made to the string. QString string("ABCDEF"); QChar ch = string.ref( 3 ); // ch == 'D' See also constref(). QString &; QString::remove ( uint index, uint len ) Removes len characters from the string starting at position index, and returns a reference to the string. If index is beyond the length of the string, nothing happens. If index is within the string, but index + len is beyond the end of the string, the string is truncated at position index. QString string( "Montreal" ); string.remove( 1, 4 ); // string == "Meal" See also insert() and replace(). QString &; QString::remove ( QChar c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Removes every occurrence of the character c in the string. Returns a reference to the string. This is the same as replace(c, ""). QString &; QString::remove ( char c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Removes every occurrence of the character c in the string. Returns a reference to the string. This is the same as replace(c, ""). QString &; QString::remove ( const QString & str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Removes every occurrence of str in the string. Returns a reference to the string. This is the same as replace(str, ""). QString &; QString::remove ( const QRegExp & rx ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Removes every occurrence of the regular expression rx in the string. Returns a reference to the string. This is the same as replace(rx, ""). QString &; QString::remove ( const char * str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Removes every occurrence of str in the string. Returns a reference to the string. QString &; QString::replace ( uint index, uint len, const QString & s ) Replaces len characters from the string with s, starting at position index, and returns a reference to the string. If index is beyond the length of the string, nothing is deleted and s is appended at the end of the string. If index is valid, but index + len is beyond the end of the string, the string is truncated at position index, then s is appended at the end. QString string( "Say yes!" ); string = string.replace( 4, 3, "NO" ); // string == "Say NO!" See also insert() and remove(). Examples: QString &; QString::replace ( uint index, uint len, const QChar * s, uint slen ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces len characters with slen characters of QChar data from s, starting at position index, and returns a reference to the string. See also insert() and remove(). QString &; QString::replace ( uint index, uint len, QChar c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. This is the same as replace(index, len, QString(c)). QString &; QString::replace ( uint index, uint len, char c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. This is the same as replace(index, len, QChar(c)). QString &; QString::replace ( QChar c, const QString & after ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces every occurrence of the character c in the string with after. Returns a reference to the string. Example: QString s = "a,b,c"; s.replace( QChar(','), " or " ); // s == "a or b or c" QString &; QString::replace ( char c, const QString & after ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces every occurrence of the character c in the string with after. Returns a reference to the string. QString &; QString::replace ( const QString & before, const QString & after ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces every occurrence of the string before in the string with the string after. Returns a reference to the string. Example: QString s = "Greek is Greek"; s.replace( "Greek", "English" ); // s == "English is English" QString &; QString::replace ( const QRegExp & rx, const QString & str ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces every occurrence of the regexp rx in the string with str. Returns a reference to the string. For example: QString s = "banana"; s.replace( QRegExp("an"), "" ); // s == "ba" For regexps containing capturing parentheses, occurrences of \1, \2, ..., in str are replaced with rx.cap(1), cap(2), ... QString t = "A bon mot."; t.replace( QRegExp("([^<]*)"), "\\emph{\\1}" ); // t == "A \\emph{bon mot}." See also find(), findRev(), and QRegExp::cap(). QString &; QString::replace ( QChar c1, QChar c2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Replaces every occurrence of c1 with the char c2. Returns a reference to the string. QString QString::right ( uint len ) const Returns a string that contains the len rightmost characters of the string. If len is greater than the length of the string then the whole string is returned. QString string( "Pineapple" ); QString t = string.right( 5 ); // t == "apple" See also left(), mid(), and isEmpty(). Example: fileiconview/qfileiconview.cpp. QString QString::rightJustify ( uint width, QChar fill = ' ', bool truncate = FALSE ) const Returns a string of length width that contains the fill character followed by the string. If truncate is FALSE and the length of the string is more than width, then the returned string is a copy of the string. If truncate is TRUE and the length of the string is more than width, then the resulting string is truncated at position width. QString string( "apple" ); QString t = string.rightJustify( 8, '.' ); // t == "...apple" See also leftJustify(). QString QString::section ( QChar sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const This function returns a section of the string. This string is treated as a sequence of fields separated by the character, sep. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left. The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see SectionFlags. QString csv( "forename,middlename,surname,phone" ); QString s = csv.section( ',', 2, 2 ); // s == "surname" QString path( "/usr/local/bin/myapp" ); // First field is empty QString s = path.section( '/', 3, 4 ); // s == "bin/myapp" QString s = path.section( '/', 3, 3, SectionSkipEmpty ); // s == "myapp" If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on. QString csv( "forename,middlename,surname,phone" ); QString s = csv.section( ',', -3, -2 ); // s == "middlename,surname" QString path( "/usr/local/bin/myapp" ); // First field is empty QString s = path.section( '/', -1 ); // s == "myapp" See also QStringList::split(). Examples: QString QString::section ( char sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const This is an overloaded member function, provided for convenience. It behaves essentially like the above function. QString QString::section ( const char * sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const This is an overloaded member function, provided for convenience. It behaves essentially like the above function. QString QString::section ( const QString & sep, int start, int end = 0xffffffff, int flags = SectionDefault ) const This is an overloaded member function, provided for convenience. It behaves essentially like the above function. This function returns a section of the string. This string is treated as a sequence of fields separated by the string, sep. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left. The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see SectionFlags. QString data( "forename**middlename**surname**phone" ); QString s = data.section( "**", 2, 2 ); // s == "surname" If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on. QString data( "forename**middlename**surname**phone" ); QString s = data.section( "**", -3, -2 ); // s == "middlename**surname" See also QStringList::split(). QString QString::section ( const QRegExp & reg, int start, int end = 0xffffffff, int flags = SectionDefault ) const This is an overloaded member function, provided for convenience. It behaves essentially like the above function. This function returns a section of the string. This string is treated as a sequence of fields separated by the regular expression, reg. The returned string consists of the fields from position start to position end inclusive. If end is not specified, all fields from position start to the end of the string are included. Fields are numbered 0, 1, 2, etc., counting from the left, and -1, -2, etc., counting from right to left. The flags argument can be used to affect some aspects of the function's behaviour, e.g. whether to be case sensitive, whether to skip empty fields and how to deal with leading and trailing separators; see SectionFlags. QString line( "forename\tmiddlename surname \t \t phone" ); QRegExp sep( "\s+" ); QString s = line.section( sep, 2, 2 ); // s == "surname" If start or end is negative, we count fields from the right of the string, the right-most field being -1, the one from right-most field being -2, and so on. QString line( "forename\tmiddlename surname \t \t phone" ); QRegExp sep( "\\s+" ); QString s = line.section( sep, -3, -2 ); // s == "middlename surname" Warning: Using this QRegExp version is much more expensive than the overloaded string and character versions. See also QStringList::split() and simplifyWhiteSpace(). QString &; QString::setAscii ( const char * str, int len = -1 ) Sets this string to str, interpreted as a classic 8-bit ASCII C string. If len is -1 (the default), then it is set to strlen(str). If str is 0 a null string is created. If str is "", an empty string is created. See also isNull() and isEmpty(). void QString::setExpand ( uint index, QChar c ) This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. Sets the character at position index to c and expands the string if necessary, filling with spaces. This method is redundant in Qt 3.x, because operator[] will expand the string as necessary. QString &; QString::setLatin1 ( const char * str, int len = -1 ) Sets this string to str, interpreted as a classic Latin1 C string. If len is -1 (the default), then it is set to strlen(str). If str is 0 a null string is created. If str is "", an empty string is created. See also isNull() and isEmpty(). void QString::setLength ( uint newLen ) Ensures that at least newLen characters are allocated to the string, and sets the length of the string to newLen. Any new space allocated contains arbitrary data. If newLen is 0, then the string becomes empty, unless the string is null, in which case it remains null. If it is not possible to allocate enough memory, the string remains unchanged. This function always detaches the string from other references to the same data. This function is useful for code that needs to build up a long string and wants to avoid repeated reallocation. In this example, we want to add to the string until some condition is true, and we're fairly sure that size is big enough: QString result; int resultLength = 0; result.setLength( newLen ) // allocate some space while ( ... ) { result[resultLength++] = ... // fill (part of) the space with data } result.truncate[resultLength]; // and get rid of the undefined junk If newLen is an underestimate, the worst that will happen is that the loop will slow down. See also truncate(), isNull(), isEmpty(), and length(). QString &; QString::setNum ( long n, int base = 10 ) Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString string; string = string.setNum( 1234 ); // string == "1234" QString &; QString::setNum ( short n, int base = 10 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString &; QString::setNum ( ushort n, int base = 10 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString &; QString::setNum ( int n, int base = 10 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString &; QString::setNum ( uint n, int base = 10 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString &; QString::setNum ( ulong n, int base = 10 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n in base base and returns a reference to the string. The base is 10 by default and must be between 2 and 36. QString &; QString::setNum ( float n, char f = 'g', int prec = 6 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n, formatted in format f with precision prec, and returns a reference to the string. The format f can be 'f', 'F', 'e', 'E', 'g' or 'G'. See arg() for an explanation of the formats. QString &; QString::setNum ( double n, char f = 'g', int prec = 6 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Sets the string to the printed value of n, formatted in format f with precision prec, and returns a reference to the string. The format f can be 'f', 'F', 'e', 'E', 'g' or 'G'. See arg() for an explanation of the formats. QString &; QString::setUnicode ( const QChar * unicode, uint len ) Resizes the string to len characters and copies unicode into the string. If unicode is 0, nothing is copied, but the string is still resized to len. If len is zero, then the string becomes a null string. See also setLatin1() and isNull(). QString &; QString::setUnicodeCodes ( const ushort * unicode_as_ushorts, uint len ) Resizes the string to len characters and copies unicode_as_ushorts into the string (on some X11 client platforms this will involve a byte-swapping pass). If unicode_as_ushorts is 0, nothing is copied, but the string is still resized to len. If len is zero, the string becomes a null string. See also setLatin1() and isNull(). QString QString::simplifyWhiteSpace () const Returns a string that has whitespace removed from the start and the end, and which has each sequence of internal whitespace replaced with a single space. Whitespace means any character for which QChar::isSpace() returns TRUE. This includes Unicode characters with decimal values 9 (TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR), and 32 (Space). QString string = " lots\t of\nwhite space "; QString t = string.simplifyWhiteSpace(); // t == "lots of white space" See also stripWhiteSpace(). QString &; QString::sprintf ( const char * cformat, ... ) Safely builds a formatted string from the format string cformat and an arbitrary list of arguments. The format string supports all the escape sequences of printf() in the standard C library. The %s escape sequence expects a utf8() encoded string. The format string cformat is expected to be in latin1. If you need a Unicode format string, use arg() instead. For typesafe string building, with full Unicode support, you can use QTextOStream like this: QString str; QString s = ...; int x = ...; QTextOStream( &str ) << s << " : " << x; For translations, especially if the strings contains more than one escape sequence, you should consider using the arg() function instead. This allows the order of the replacements to be controlled by the translator, and has Unicode support. See also arg(). Examples: bool QString::startsWith ( const QString & s ) const Returns TRUE if the string starts with s; otherwise returns FALSE. QString string("Bananas"); bool a = string.startsWith("Ban"); // a == TRUE See also endsWith(). QString QString::stripWhiteSpace () const Returns a string that has whitespace removed from the start and the end. Whitespace means any character for which QChar::isSpace() returns TRUE. This includes Unicode characters with decimal values 9 (TAB), 10 (LF), 11 (VT), 12 (FF), 13 (CR) and 32 (Space), and may also include other Unicode characters. QString string = " white space "; QString s = string.stripWhiteSpace(); // s == "white space" See also simplifyWhiteSpace(). double QString::toDouble ( bool * ok = 0 ) const Returns the string converted to a double value. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. QString string( "1234.56" ); double a = string.toDouble(); // a == 1234.56 See also number(). float QString::toFloat ( bool * ok = 0 ) const Returns the string converted to a float value. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. See also number(). int QString::toInt ( bool * ok = 0, int base = 10 ) const Returns the string converted to an int value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. QString str( "FF" ); bool ok; int hex = str.toInt( &ok, 16 ); // hex == 255, ok == TRUE int dec = str.toInt( &ok, 10 ); // dec == 0, ok == FALSE See also number(). long QString::toLong ( bool * ok = 0, int base = 10 ) const Returns the string converted to a long value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. See also number(). short QString::toShort ( bool * ok = 0, int base = 10 ) const Returns the string converted to a short value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. uint QString::toUInt ( bool * ok = 0, int base = 10 ) const Returns the string converted to an unsigned int value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. See also number(). ulong QString::toULong ( bool * ok = 0, int base = 10 ) const Returns the string converted to an unsigned long value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. See also number(). ushort QString::toUShort ( bool * ok = 0, int base = 10 ) const Returns the string converted to an unsigned short value to the base base, which is 10 by default and must be between 2 and 36. If ok is not 0: if a conversion error occurs, *ok is set to FALSE; otherwise *ok is set to TRUE. void QString::truncate ( uint newLen ) If newLen is less than the length of the string, then the string is truncated at position newLen. Otherwise nothing happens. QString s = "truncate me"; s.truncate( 5 ); // s == "trunc" See also setLength(). Example: network/mail/smtp.cpp. const unsigned short * QString::ucs2 () const Returns the QString as a zero terminated array of unsigned shorts if the string is not null; otherwise returns zero. The result remains valid so long as one unmodified copy of the source string exists. const QChar * QString::unicode () const Returns the Unicode representation of the string. The result remains valid until the string is modified. QString QString::upper () const Returns an uppercase copy of the string. QString string( "TeXt" ); str = string.upper(); // t == "TEXT" See also lower(). Examples: QCString QString::utf8 () const Returns the string encoded in UTF-8 format. See QTextCodec for more diverse coding/decoding of Unicode strings. See also fromUtf8(), ascii(), latin1(), and local8Bit(). RELATED FUNCTION DOCUMENTATION bool operator!= ( const QString & s1, const QString & s2 ) Returns TRUE if s1 is not equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) != 0. See also isNull() and isEmpty(). bool operator!= ( const QString & s1, const char * s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is not equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) != 0. See also isNull() and isEmpty(). bool operator!= ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is not equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) != 0. See also isNull() and isEmpty(). const QString operator+ ( const QString &; s1, const QString & s2 ) Returns a string which is the result of concatenating the string s1 and the string s2. Equivalent to s1.append(s2). const QString operator+ ( const QString &; s1, const char * s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns a string which is the result of concatenating the string s1 and character s2. Equivalent to s1.append(s2). const QString operator+ ( const char * s1, const QString &; s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns a string which is the result of concatenating the character s1 and string s2. const QString operator+ ( const QString &; s, char c ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns a string which is the result of concatenating the string s and character c. Equivalent to s.append(c). const QString operator+ ( char c, const QString &; s ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns a string which is the result of concatenating the character c and string s. Equivalent to s.prepend(c). bool operator<; ( const QString & s1, const char * s2 ) Returns TRUE if s1 is lexically less than s2; otherwise returns FALSE. The comparison is case sensitive. Equivalent to compare(s1, s2) < 0. bool operator<; ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is lexically less than s2; otherwise returns FALSE. The comparison is case sensitive. Equivalent to compare(s1, s2) < 0. QDataStream &; operator<< ( QDataStream & s, const QString & str ) Writes the string str to the stream s. See also Format of the QDataStream operators bool operator<;= ( const QString & s1, const char * s2 ) Returns TRUE if s1 is lexically less than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1,s2) <= 0. See also isNull() and isEmpty(). bool operator<;= ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is lexically less than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) <= 0. See also isNull() and isEmpty(). bool operator== ( const QString & s1, const QString & s2 ) Returns TRUE if s1 is equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) != 0. See also isNull() and isEmpty(). bool operator== ( const QString & s1, const char * s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) == 0. See also isNull() and isEmpty(). bool operator== ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is equal to s2; otherwise returns FALSE. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) == 0. See also isNull() and isEmpty(). bool operator>; ( const QString & s1, const char * s2 ) Returns TRUE if s1 is lexically greater than s2; otherwise returns FALSE. The comparison is case sensitive. Equivalent to compare(s1, s2) > 0. bool operator>; ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is lexically greater than s2; otherwise returns FALSE. The comparison is case sensitive. Equivalent to compare(s1, s2) > 0. bool operator>;= ( const QString & s1, const char * s2 ) Returns TRUE if s1 is lexically greater than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) >= 0. See also isNull() and isEmpty(). bool operator>;= ( const char * s1, const QString & s2 ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Returns TRUE if s1 is lexically greater than or equal to s2; otherwise returns FALSE. The comparison is case sensitive. Note that a null string is not equal to a not-null empty string. Equivalent to compare(s1, s2) >= 0. See also isNull() and isEmpty(). QDataStream &; operator>> ( QDataStream & s, QString & str ) Reads a string from the stream s into string str. See also Format of the QDataStream operators SEE ALSO http://doc.trolltech.com/qstring.html http://www.trolltech.com/faq/tech.html COPYRIGHT Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR Generated automatically from the source code. BUGS If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at \$QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qstring.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QString(3qt)