.TH "KStringHandler" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KStringHandler \- This class contains utility functions for handling strings. Class for manipulating words and sentences in strings.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kstringhandler.h>\fP
.PP
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQString\fP \fBword\fP (const \fBQString\fP &text, uint pos) KDE_DEPRECATED"
.br
.ti -1c
.RI "static \fBQString\fP \fBword\fP (const \fBQString\fP &text, const char *range)"
.br
.ti -1c
.RI "static \fBQString\fP \fBinsword\fP (const \fBQString\fP &text, const \fBQString\fP &word, uint pos)"
.br
.ti -1c
.RI "static \fBQString\fP \fBsetword\fP (const \fBQString\fP &text, const \fBQString\fP &word, uint pos)"
.br
.ti -1c
.RI "static \fBQString\fP \fBremrange\fP (const \fBQString\fP &text, const char *range)"
.br
.ti -1c
.RI "static \fBQString\fP \fBremword\fP (const \fBQString\fP &text, uint pos)"
.br
.ti -1c
.RI "static \fBQString\fP \fBremword\fP (const \fBQString\fP &text, const \fBQString\fP &word)"
.br
.ti -1c
.RI "static \fBQString\fP \fBcapwords\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBcapwords\fP (const \fBQStringList\fP &list)"
.br
.ti -1c
.RI "static \fBQString\fP \fBreverse\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBreverse\fP (const \fBQStringList\fP &list)"
.br
.ti -1c
.RI "static \fBQString\fP \fBljust\fP (const \fBQString\fP &text, uint width) KDE_DEPRECATED"
.br
.ti -1c
.RI "static \fBQString\fP \fBrjust\fP (const \fBQString\fP &text, uint width) KDE_DEPRECATED"
.br
.ti -1c
.RI "static \fBQString\fP \fBcenter\fP (const \fBQString\fP &text, uint width)"
.br
.ti -1c
.RI "static \fBQString\fP \fBlsqueeze\fP (const \fBQString\fP &str, uint maxlen=40)"
.br
.ti -1c
.RI "static \fBQString\fP \fBlEmSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxlen=30)"
.br
.ti -1c
.RI "static \fBQString\fP \fBlPixelSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxPixels)"
.br
.ti -1c
.RI "static \fBQString\fP \fBcsqueeze\fP (const \fBQString\fP &str, uint maxlen=40)"
.br
.ti -1c
.RI "static \fBQString\fP \fBcEmSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxlen=30)"
.br
.ti -1c
.RI "static \fBQString\fP \fBcPixelSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxPixels)"
.br
.ti -1c
.RI "static \fBQString\fP \fBrsqueeze\fP (const \fBQString\fP &str, uint maxlen=40)"
.br
.ti -1c
.RI "static \fBQString\fP \fBrEmSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxlen=30)"
.br
.ti -1c
.RI "static \fBQString\fP \fBrPixelSqueeze\fP (const \fBQString\fP &name, const \fBQFontMetrics\fP &fontMetrics, uint maxPixels)"
.br
.ti -1c
.RI "static bool \fBmatchFileName\fP (const \fBQString\fP &filename, const \fBQString\fP &pattern)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBperlSplit\fP (const \fBQString\fP &sep, const \fBQString\fP &s, uint max=0)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBperlSplit\fP (const \fBQChar\fP &sep, const \fBQString\fP &s, uint max=0)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBperlSplit\fP (const \fBQRegExp\fP &sep, const \fBQString\fP &s, uint max=0)"
.br
.ti -1c
.RI "static \fBQString\fP \fBtagURLs\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "static \fBQString\fP \fBobscure\fP (const \fBQString\fP &str)"
.br
.ti -1c
.RI "static bool \fBisUtf8\fP (const char *str)"
.br
.ti -1c
.RI "static \fBQString\fP \fBfrom8Bit\fP (const char *str)"
.br
.ti -1c
.RI "static KDE_DEPRECATED bool \fBmatchFilename\fP (const \fBQString\fP &filename, const \fBQString\fP &pattern)"
.br
.in -1c
.SH "Detailed Description"
.PP 
This class contains utility functions for handling strings. Class for manipulating words and sentences in strings. 

This class is \fInot\fP a substitute for the \fBQString\fP class. What I tried to do with this class is provide an easy way to cut/slice/splice words inside sentences in whatever order desired. While the main focus of this class are words (ie characters separated by spaces/tabs), the two core functions here ( split() and join() ) will function given any char to use as a separator. This will make it easy to redefine what a 'word' means in the future if needed.
.PP
I freely stole some of the function names from python. I also think some of these were influenced by mIRC (yes, believe it if you will, I used to write a LOT of scripts in mIRC).
.PP
The ranges are a fairly powerful way of getting/stripping words from a string. These ranges function, for the large part, as they would in python. See the word(const QString&, int) and remword(const QString&, int) functions for more detail.
.PP
This class contains no data members of it own. All strings are cut on the fly and returned as new qstrings/qstringlists.
.PP
Quick example on how to use:
.PP
.PP
.nf
 KStringHandler kstr;
 QString line = 'This is a test of the strings';

 cout << '1> ' << kstr.word( line , '4:' ) << '\n';
 cout << '2> ' << kstr.remrange( line , '2:5' ) << '\n';
 cout << '2> ' << kstr.reverse( line ) << '\n';
 cout << '2> ' << kstr.center( kstr.word( line , 4 ) , 15 ) << '\n';
.fi
.PP
.PP
and so forth.
.PP
\fBAuthor:\fP
.RS 4
Ian Zepp <icszepp@islc.net> 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKShell\fP 
.RE
.PP

.PP
Definition at line 70 of file kstringhandler.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KStringHandler::word (const \fBQString\fP & text, uint pos)\fC [static]\fP"
.PP
Returns the nth word in the string if found Returns a EMPTY (not null) string otherwise. 
.PP
Note that the FIRST index is 0. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the string to search for the words 
.br
\fIpos\fP the position of the word to search 
.RE
.PP
\fBReturns:\fP
.RS 4
the word, or an empty string if not found 
.RE
.PP
\fBDeprecated\fP
.RS 4
use \fBQString::section\fP instead 
.RE
.PP

.PP
Definition at line 43 of file kstringhandler.cpp.
.PP
References QString::section().
.PP
Referenced by insword(), remword(), and setword().
.SS "\fBQString\fP KStringHandler::word (const \fBQString\fP & text, const char * range)\fC [static]\fP"
.PP
Returns a range of words from that string. 
.PP
Ie: 
.PD 0

.IP "\(bu" 2
'0' returns the very first word 
.IP "\(bu" 2
'0:' returns the first to the last word 
.IP "\(bu" 2
'0:3' returns the first to fourth words 
.IP "\(bu" 2
':3' returns everything up to the fourth word
.PP
If you grok python, you're set. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the string to search for the words 
.br
\fIrange\fP the words to return (see description) 
.RE
.PP
\fBReturns:\fP
.RS 4
the words, or an empty string if not found 
.RE
.PP

.PP
Definition at line 48 of file kstringhandler.cpp.
.PP
References QStringList::split(), and QString::stripWhiteSpace().
.SS "\fBQString\fP KStringHandler::insword (const \fBQString\fP & text, const \fBQString\fP & word, uint pos)\fC [static]\fP"
.PP
Inserts a word into the string, and returns a new string with the word included. 
.PP
the first index is zero (0). If there are not \fCpos\fP words in the original string, the new word will be appended to the end. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the original text 
.br
\fIword\fP the word to insert 
.br
\fIpos\fP the position (in words) for the new word 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 84 of file kstringhandler.cpp.
.PP
References QString::isEmpty(), QStringList::join(), QStringList::split(), and word().
.SS "\fBQString\fP KStringHandler::setword (const \fBQString\fP & text, const \fBQString\fP & word, uint pos)\fC [static]\fP"
.PP
Replaces a word in the string, and returns a new string with the word included. 
.PP
the first index is zero (0). If there are not \fCpos\fP words in the original string, the new word will be appended to the end. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the original text 
.br
\fIword\fP the word to insert 
.br
\fIpos\fP the position (in words) for the new word 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 104 of file kstringhandler.cpp.
.PP
References QString::isEmpty(), QStringList::join(), QStringList::split(), and word().
.SS "\fBQString\fP KStringHandler::remrange (const \fBQString\fP & text, const char * range)\fC [static]\fP"
.PP
Removes a word or ranges of words from the string, and returns a new string. 
.PP
The ranges definitions follow the definitions for the \fBword()\fP function.
.PP
.PD 0
.IP "\(bu" 2
'0' removes the very first word 
.IP "\(bu" 2
'0:' removes the first the the last word 
.IP "\(bu" 2
'0:3' removes the first to fourth words 
.IP "\(bu" 2
':3' removes everything up to the fourth word 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the original text 
.br
\fIrange\fP the words to remove (see description) 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP

.PP
Definition at line 126 of file kstringhandler.cpp.
.PP
References QStringList::join(), and QStringList::split().
.SS "\fBQString\fP KStringHandler::remword (const \fBQString\fP & text, uint pos)\fC [static]\fP"
.PP
Removes a word at the given index, and returns a new string. 
.PP
The first index is zero (0). 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the original text 
.br
\fIpos\fP the position (in words) of thw word to delete 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 155 of file kstringhandler.cpp.
.PP
References QStringList::join(), and QStringList::split().
.SS "\fBQString\fP KStringHandler::remword (const \fBQString\fP & text, const \fBQString\fP & word)\fC [static]\fP"
.PP
Removes a matching word from the string, and returns a new string. 
.PP
Note that only ONE match is removed. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the original text 
.br
\fIword\fP the word to remove 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 172 of file kstringhandler.cpp.
.PP
References QString::isEmpty(), QStringList::join(), QStringList::split(), and word().
.SS "\fBQString\fP KStringHandler::capwords (const \fBQString\fP & text)\fC [static]\fP"
.PP
Capitalizes each word in the string 'hello there' becomes 'Hello There' (string). 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to capitalize 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 197 of file kstringhandler.cpp.
.PP
References QStringList::join(), QString::replace(), and QString::stripWhiteSpace().
.SS "\fBQStringList\fP KStringHandler::capwords (const \fBQStringList\fP & list)\fC [static]\fP"
.PP
Capitalizes each word in the list [hello, there] becomes [Hello, There] (list). 
.PP
\fBParameters:\fP
.RS 4
\fIlist\fP the list to capitalize 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting list 
.RE
.PP

.PP
Definition at line 211 of file kstringhandler.cpp.
.PP
References QString::mid(), and QString::upper().
.SS "\fBQString\fP KStringHandler::reverse (const \fBQString\fP & text)\fC [static]\fP"
.PP
Reverses the order of the words in a string 'hello there' becomes 'there hello' (string). 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to reverse 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 223 of file kstringhandler.cpp.
.PP
References QStringList::join(), and QStringList::split().
.SS "\fBQStringList\fP KStringHandler::reverse (const \fBQStringList\fP & list)\fC [static]\fP"
.PP
Reverses the order of the words in a list [hello, there] becomes [there, hello] (list). 
.PP
\fBParameters:\fP
.RS 4
\fIlist\fP the list to reverse 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting list 
.RE
.PP

.PP
Definition at line 237 of file kstringhandler.cpp.
.SS "\fBQString\fP KStringHandler::ljust (const \fBQString\fP & text, uint width)\fC [static]\fP"
.PP
Left-justifies a string and returns a string at least 'width' characters wide. 
.PP
If the string is longer than the \fCwidth\fP, the original string is returned. It is never truncated. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to justify 
.br
\fIwidth\fP the desired width of the new string 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP
\fBDeprecated\fP
.RS 4
use \fBQString::leftJustify\fP instead 
.RE
.PP

.PP
Definition at line 255 of file kstringhandler.cpp.
.PP
References QString::leftJustify(), and QString::stripWhiteSpace().
.SS "\fBQString\fP KStringHandler::rjust (const \fBQString\fP & text, uint width)\fC [static]\fP"
.PP
Right-justifies a string and returns a string at least 'width' characters wide. 
.PP
If the string is longer than the \fCwidth\fP, the original string is returned. It is never truncated. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to justify 
.br
\fIwidth\fP the desired width of the new string 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP
\fBDeprecated\fP
.RS 4
use \fBQString::rightJustify\fP instead 
.RE
.PP

.PP
Definition at line 260 of file kstringhandler.cpp.
.PP
References QString::rightJustify(), and QString::stripWhiteSpace().
.SS "\fBQString\fP KStringHandler::center (const \fBQString\fP & text, uint width)\fC [static]\fP"
.PP
Centers a string and returns a string at least 'width' characters wide. 
.PP
If the string is longer than the \fCwidth\fP, the original string is returned. It is never truncated. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the text to justify 
.br
\fIwidth\fP the desired width of the new string 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting string 
.RE
.PP

.PP
Definition at line 265 of file kstringhandler.cpp.
.PP
References QString::fill(), QString::leftJustify(), QString::length(), and QString::stripWhiteSpace().
.SS "\fBQString\fP KStringHandler::lsqueeze (const \fBQString\fP & str, uint maxlen = \fC40\fP)\fC [static]\fP"
.PP
Substitute characters at the beginning of a string by '...'. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP is the string to modify 
.br
\fImaxlen\fP is the maximum length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP

.PP
Definition at line 280 of file kstringhandler.cpp.
.SS "\fBQString\fP KStringHandler::lEmSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxlen = \fC30\fP)\fC [static]\fP"
.PP
Substitute characters at the beginning of a string by '...'. 
.PP
Similar to method above, except that it truncates based on pixel width rather than the number of characters 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxlen\fP is the maximum length in ems the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 307 of file kstringhandler.cpp.
.PP
References lPixelSqueeze().
.SS "\fBQString\fP KStringHandler::lPixelSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxPixels)\fC [static]\fP"
.PP
Substitute characters at the beginning of a string by '...'. 
.PP
Similar to method above, except that maxlen is the width in pixels to truncate to 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxPixels\fP is the maximum pixel length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 312 of file kstringhandler.cpp.
.PP
References QString::isEmpty(), and QString::remove().
.PP
Referenced by lEmSqueeze().
.SS "\fBQString\fP KStringHandler::csqueeze (const \fBQString\fP & str, uint maxlen = \fC40\fP)\fC [static]\fP"
.PP
Substitute characters at the middle of a string by '...'. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP is the string to modify 
.br
\fImaxlen\fP is the maximum length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP

.PP
Definition at line 289 of file kstringhandler.cpp.
.SS "\fBQString\fP KStringHandler::cEmSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxlen = \fC30\fP)\fC [static]\fP"
.PP
Substitute characters in the middle of a string by '...'. 
.PP
Similar to method above, except that it truncates based on pixel width rather than the number of characters 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxlen\fP is the maximum length in ems the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 337 of file kstringhandler.cpp.
.PP
References cPixelSqueeze().
.SS "\fBQString\fP KStringHandler::cPixelSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxPixels)\fC [static]\fP"
.PP
Substitute characters in the middle of a string by '...'. 
.PP
Similar to method above, except that maxlen is the width in pixels to truncate to 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxPixels\fP is the maximum pixel length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 342 of file kstringhandler.cpp.
.PP
References QString::left(), QString::length(), and QString::right().
.PP
Referenced by cEmSqueeze().
.SS "\fBQString\fP KStringHandler::rsqueeze (const \fBQString\fP & str, uint maxlen = \fC40\fP)\fC [static]\fP"
.PP
Substitute characters at the end of a string by '...'. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP is the string to modify 
.br
\fImaxlen\fP is the maximum length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP

.PP
Definition at line 298 of file kstringhandler.cpp.
.SS "\fBQString\fP KStringHandler::rEmSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxlen = \fC30\fP)\fC [static]\fP"
.PP
Substitute characters at the end of a string by '...'. 
.PP
Similar to method above, except that it truncates based on pixel width rather than the number of characters 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxlen\fP is the maximum length in ems the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 384 of file kstringhandler.cpp.
.PP
References rPixelSqueeze().
.SS "\fBQString\fP KStringHandler::rPixelSqueeze (const \fBQString\fP & name, const \fBQFontMetrics\fP & fontMetrics, uint maxPixels)\fC [static]\fP"
.PP
Substitute characters at the end of a string by '...'. 
.PP
Similar to method above, except that maxlen is the width in pixels to truncate to 
.PP
\fBParameters:\fP
.RS 4
\fIname\fP is the string to modify 
.br
\fIfontMetrics\fP is the font metrics to use to calculate character sizes 
.br
\fImaxPixels\fP is the maximum pixel length the modified string will have If the original string is shorter than 'maxlen', it is returned verbatim 
.RE
.PP
\fBReturns:\fP
.RS 4
the modified string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 389 of file kstringhandler.cpp.
.PP
References QString::isEmpty(), QString::length(), and QString::remove().
.PP
Referenced by rEmSqueeze().
.SS "bool KStringHandler::matchFileName (const \fBQString\fP & filename, const \fBQString\fP & pattern)\fC [static]\fP"
.PP
Match a filename. 
.PP
\fBParameters:\fP
.RS 4
\fIfilename\fP is the real decoded filename (or dirname without trailing '/'). 
.br
\fIpattern\fP is a pattern like *.txt, *.tar.gz, Makefile.*, *README*, etc. Patterns with two asterisks like '*.*pk' are not supported. 
.RE
.PP
\fBReturns:\fP
.RS 4
true if the given filename matches the given pattern 
.RE
.PP

.PP
Definition at line 417 of file kstringhandler.cpp.
.PP
References QString::find(), QString::length(), and QString::unicode().
.SS "\fBQStringList\fP KStringHandler::perlSplit (const \fBQString\fP & sep, const \fBQString\fP & s, uint max = \fC0\fP)\fC [static]\fP"
.PP
Split a \fBQString\fP into a \fBQStringList\fP in a similar fashion to the static \fBQStringList\fP function in \fBQt\fP, except you can specify a maximum number of tokens. 
.PP
If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.
.PP
Example: 
.PP
.nf
 perlSplit('__', 'some__string__for__you__here', 4)
 QStringList contains: 'some', 'string', 'for', 'you__here'

.fi
.PP
.PP
\fBParameters:\fP
.RS 4
\fIsep\fP is the string to use to delimit s. 
.br
\fIs\fP is the input string 
.br
\fImax\fP is the maximum number of extractions to perform, or 0. 
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBQStringList\fP containing tokens extracted from s. 
.RE
.PP

.PP
Definition at line 456 of file kstringhandler.cpp.
.SS "\fBQStringList\fP KStringHandler::perlSplit (const \fBQChar\fP & sep, const \fBQString\fP & s, uint max = \fC0\fP)\fC [static]\fP"
.PP
Split a \fBQString\fP into a \fBQStringList\fP in a similar fashion to the static \fBQStringList\fP function in \fBQt\fP, except you can specify a maximum number of tokens. 
.PP
If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.
.PP
Example: 
.PP
.nf
 perlSplit(' ', 'kparts reaches the parts other parts can't', 3)
 QStringList contains: 'kparts', 'reaches', 'the parts other parts can't'

.fi
.PP
.PP
\fBParameters:\fP
.RS 4
\fIsep\fP is the character to use to delimit s. 
.br
\fIs\fP is the input string 
.br
\fImax\fP is the maximum number of extractions to perform, or 0. 
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBQStringList\fP containing tokens extracted from s. 
.RE
.PP

.PP
Definition at line 482 of file kstringhandler.cpp.
.SS "\fBQStringList\fP KStringHandler::perlSplit (const \fBQRegExp\fP & sep, const \fBQString\fP & s, uint max = \fC0\fP)\fC [static]\fP"
.PP
Split a \fBQString\fP into a \fBQStringList\fP in a similar fashion to the static \fBQStringList\fP function in \fBQt\fP, except you can specify a maximum number of tokens. 
.PP
If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.
.PP
Example: 
.PP
.nf
 perlSplit(QRegExp('[! ]', 'Split me up ! I'm bored ! OK ?', 3)
 QStringList contains: 'Split', 'me', 'up ! I'm bored, OK ?'

.fi
.PP
.PP
\fBParameters:\fP
.RS 4
\fIsep\fP is the regular expression to use to delimit s. 
.br
\fIs\fP is the input string 
.br
\fImax\fP is the maximum number of extractions to perform, or 0. 
.RE
.PP
\fBReturns:\fP
.RS 4
A \fBQStringList\fP containing tokens extracted from s. 
.RE
.PP

.PP
Definition at line 508 of file kstringhandler.cpp.
.SS "\fBQString\fP KStringHandler::tagURLs (const \fBQString\fP & text)\fC [static]\fP"
.PP
This method auto-detects URLs in strings, and adds HTML markup to them so that richtext or HTML-enabled widgets (such as \fBKActiveLabel\fP) will display the URL correctly. 
.PP
\fBParameters:\fP
.RS 4
\fItext\fP the string which may contain URLs 
.RE
.PP
\fBReturns:\fP
.RS 4
the resulting text 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 535 of file kstringhandler.cpp.
.PP
References QString::length(), QRegExp::matchedLength(), QString::mid(), QString::replace(), and QRegExp::search().
.SS "\fBQString\fP KStringHandler::obscure (const \fBQString\fP & str)\fC [static]\fP"
.PP
Obscure string by using a simple symmetric encryption. 
.PP
Applying the function to a string obscured by this function will result in the original string.
.PP
The function can be used to obscure passwords stored to configuration files. Note that this won't give you any more security than preventing that the password is directly copied and pasted.
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP string to be obscured 
.RE
.PP
\fBReturns:\fP
.RS 4
obscured string 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 560 of file kstringhandler.cpp.
.PP
References QChar::unicode(), and QString::unicode().
.SS "bool KStringHandler::isUtf8 (const char * str)\fC [static]\fP"
.PP
Guess whether a string is UTF8 encoded. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the string to check 
.RE
.PP
\fBReturns:\fP
.RS 4
true if UTF8. If false, the string is probably in Local8Bit. 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 571 of file kstringhandler.cpp.
.PP
Referenced by from8Bit().
.SS "\fBQString\fP KStringHandler::from8Bit (const char * str)\fC [static]\fP"
.PP
Construct \fBQString\fP from a c string, guessing whether it is UTF8- or Local8Bit-encoded. 
.PP
\fBParameters:\fP
.RS 4
\fIstr\fP the input string 
.RE
.PP
\fBReturns:\fP
.RS 4
the (hopefully correctly guessed) \fBQString\fP representation of \fCstr\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 656 of file kstringhandler.cpp.
.PP
References QString::fromLocal8Bit(), QString::fromUtf8(), isUtf8(), and KGlobal::staticQString().
.PP
Referenced by KConfigBase::readEntry(), and KConfigBase::writeEntry().
.SS "static KDE_DEPRECATED bool KStringHandler::matchFilename (const \fBQString\fP & filename, const \fBQString\fP & pattern)\fC [inline, static]\fP"
.PP
\fBDeprecated\fP
.RS 4
Use
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmatchFileName\fP () instead. 
.RE
.PP

.PP
Definition at line 436 of file kstringhandler.h.

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
