\section{KString\-Handler Class Reference}
\label{classKStringHandler}\index{KStringHandler@{KStringHandler}}
This class is {\em not\/} a substitute for the {\bf QString} class. Class for manipulating words and sentences in strings.  


{\tt \#include $<$kstringhandler.h$>$}

\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
{\bf QString} {\bf word} (const  {\bf QString} \&text, uint pos)
\begin{CompactList}\small\item\em Returns the nth word in the string if found Returns a EMPTY (not null) string otherwise. \item\end{CompactList}\item 
{\bf QString} {\bf word} (const  {\bf QString} \&text, const  char $\ast$range)
\begin{CompactList}\small\item\em Returns a range of words from that string. \item\end{CompactList}\item 
{\bf QString} {\bf insword} (const  {\bf QString} \&text, const  {\bf QString} \&word, uint pos)
\begin{CompactList}\small\item\em Inserts a word into the string, and returns a new string with the word included. \item\end{CompactList}\item 
{\bf QString} {\bf setword} (const  {\bf QString} \&text, const  {\bf QString} \&word, uint pos)
\begin{CompactList}\small\item\em Replaces a word in the string, and returns a new string with the word included. \item\end{CompactList}\item 
{\bf QString} {\bf remrange} (const  {\bf QString} \&text, const  char $\ast$range)
\begin{CompactList}\small\item\em Removes a word or ranges of words from the string, and returns a new string. \item\end{CompactList}\item 
{\bf QString} {\bf remword} (const  {\bf QString} \&text, uint pos)
\begin{CompactList}\small\item\em Removes a word at the given index, and returns a new string. \item\end{CompactList}\item 
{\bf QString} {\bf remword} (const  {\bf QString} \&text, const  {\bf QString} \&word)
\begin{CompactList}\small\item\em Removes a matching word from the string, and returns a new string. \item\end{CompactList}\item 
{\bf QString} {\bf capwords} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em Capitalizes each word in the string \char`\"{}hello there\char`\"{} becomes \char`\"{}Hello There\char`\"{} (string). \item\end{CompactList}\item 
{\bf QString\-List} {\bf capwords} (const  {\bf QString\-List} \&list)
\begin{CompactList}\small\item\em Capitalizes each word in the list [hello, there] becomes [Hello, There] (list). \item\end{CompactList}\item 
{\bf QString} {\bf reverse} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em Reverses the order of the words in a string \char`\"{}hello there\char`\"{} becomes \char`\"{}there hello\char`\"{} (string). \item\end{CompactList}\item 
{\bf QString\-List} {\bf reverse} (const  {\bf QString\-List} \&list)
\begin{CompactList}\small\item\em Reverses the order of the words in a list [hello, there] becomes [there, hello] (list). \item\end{CompactList}\item 
{\bf QString} {\bf ljust} (const  {\bf QString} \&text, uint width)
\begin{CompactList}\small\item\em Left-justifies a string and returns a string at least 'width' characters wide. \item\end{CompactList}\item 
{\bf QString} {\bf rjust} (const  {\bf QString} \&text, uint width)
\begin{CompactList}\small\item\em Right-justifies a string and returns a string at least 'width' characters wide. \item\end{CompactList}\item 
{\bf QString} {\bf center} (const  {\bf QString} \&text, uint width)
\begin{CompactList}\small\item\em Centers a string and returns a string at least 'width' characters wide. \item\end{CompactList}\item 
{\bf QString} {\bf lsqueeze} (const  {\bf QString} \&str, uint maxlen=40)
\begin{CompactList}\small\item\em Substitute characters at the beginning of a string by \char`\"{}...\char`\"{}. \item\end{CompactList}\item 
{\bf QString} {\bf csqueeze} (const  {\bf QString} \&str, uint maxlen=40)
\begin{CompactList}\small\item\em Substitute characters at the middle of a string by \char`\"{}...\char`\"{}. \item\end{CompactList}\item 
{\bf QString} {\bf rsqueeze} (const  {\bf QString} \&str, uint maxlen=40)
\begin{CompactList}\small\item\em Substitute characters at the end of a string by \char`\"{}...\char`\"{}. \item\end{CompactList}\item 
bool {\bf match\-File\-Name} (const  {\bf QString} \&filename, const  {\bf QString} \&pattern)
\begin{CompactList}\small\item\em Match a filename. \item\end{CompactList}\item 
{\bf QString\-List} {\bf perl\-Split} (const  {\bf QString} \&sep, const  {\bf QString} \&s, uint max=0)
\begin{CompactList}\small\item\em Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. \item\end{CompactList}\item 
{\bf QString\-List} {\bf perl\-Split} (const  {\bf QChar} \&sep, const  {\bf QString} \&s, uint max=0)
\begin{CompactList}\small\item\em Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. \item\end{CompactList}\item 
{\bf QString\-List} {\bf perl\-Split} (const  {\bf QReg\-Exp} \&sep, const  {\bf QString} \&s, uint max=0)
\begin{CompactList}\small\item\em Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. \item\end{CompactList}\item 
{\bf QString} {\bf tag\-URLs} (const  {\bf QString} \&text)
\begin{CompactList}\small\item\em This method auto-detects URLs in strings, and adds HTML markup to them so that richtext or HTML-enabled widgets (such as {\bf KActive\-Label}) will display the URL correctly. \item\end{CompactList}\item 
bool {\bf match\-Filename} (const  {\bf QString} \&filename, const  {\bf QString} \&pattern)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} Use \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
This class is {\em not\/} a substitute for the {\bf QString} class. Class for manipulating words and sentences in strings. 

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.

I freely stole some of the function names from python. I also think some of these were influenced by m\-IRC (yes, believe it if you will, I used to write a LOT of scripts in m\-IRC).

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 {\bf word}{\rm (p.\,\pageref{classKStringHandler_e0})}(const {\bf QString}\&, int) and {\bf remword}{\rm (p.\,\pageref{classKStringHandler_e5})}(const {\bf QString}\&, int) functions for more detail.

This class contains no data members of it own. All strings are cut on the fly and returned as new qstrings/qstringlists.

Quick example on how to use:

\small\begin{alltt}
 KStringHandler kstr;
 {\bf QString} line = "This is a test of the strings";\end{alltt}\normalsize 


\small\begin{alltt} cout $<$$<$ "1> " $<$$<$ kstr.word( line , "4:" ) $<$$<$ "\(\backslash\)n";
 cout $<$$<$ "2> " $<$$<$ kstr.remrange( line , "2:5" ) $<$$<$ "\(\backslash\)n";
 cout $<$$<$ "2> " $<$$<$ kstr.reverse( line ) $<$$<$ "\(\backslash\)n";
 cout $<$$<$ "2> " $<$$<$ kstr.center( kstr.word( line , 4 ) , 15 ) $<$$<$ "\(\backslash\)n";
 \end{alltt}\normalsize 


and so forth.

\begin{Desc}
\item[Author:]Ian Zepp $<${\tt icszepp@islc.net}$>$ \end{Desc}




Definition at line 66 of file kstringhandler.h.

\subsection{Member Function Documentation}
\index{KStringHandler@{KString\-Handler}!word@{word}}
\index{word@{word}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::word (const {\bf QString} \& {\em text}, uint {\em pos})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e0}


Returns the nth word in the string if found Returns a EMPTY (not null) string otherwise. 

Note that the FIRST index is 0. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]the string to search for the words \item[{\em pos}]the position of the word to search \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the word, or an empty string if not found \end{Desc}


Definition at line 26 of file kstringhandler.cpp.

References QString\-List::split().

Referenced by capwords().\index{KStringHandler@{KString\-Handler}!word@{word}}
\index{word@{word}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::word (const {\bf QString} \& {\em text}, const char $\ast$ {\em range})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e1}


Returns a range of words from that string. 

Ie: \begin{itemize}
\item \char`\"{}0\char`\"{} returns the very first word \item \char`\"{}0:\char`\"{} returns the first to the last word \item \char`\"{}0:3\char`\"{} returns the first to fourth words \item \char`\"{}:3\char`\"{} returns everything up to the fourth word\end{itemize}
If you grok python, you're set. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]the string to search for the words \item[{\em range}]the words to return (see description) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the words, or an empty string if not found \end{Desc}


Definition at line 36 of file kstringhandler.cpp.

References QString::ascii(), QString::find(), QString::is\-Empty(), QString::left(), QString::remove(), QString\-List::split(), and QString::strip\-White\-Space().\index{KStringHandler@{KString\-Handler}!insword@{insword}}
\index{insword@{insword}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::insword (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em word}, uint {\em pos})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e2}


Inserts a word into the string, and returns a new string with the word included. 

the first index is zero (0). If there are not {\tt pos} words in the original string, the new word will be appended to the end. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the original text \item[{\em word}]the word to insert \item[{\em pos}]the position (in words) for the new word \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 104 of file kstringhandler.cpp.

References QString::is\-Empty(), QString\-List::join(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!setword@{setword}}
\index{setword@{setword}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::setword (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em word}, uint {\em pos})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e3}


Replaces a word in the string, and returns a new string with the word included. 

the first index is zero (0). If there are not {\tt pos} words in the original string, the new word will be appended to the end. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the original text \item[{\em word}]the word to insert \item[{\em pos}]the position (in words) for the new word \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 124 of file kstringhandler.cpp.

References QString::is\-Empty(), QString\-List::join(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!remrange@{remrange}}
\index{remrange@{remrange}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::remrange (const {\bf QString} \& {\em text}, const char $\ast$ {\em range})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e4}


Removes a word or ranges of words from the string, and returns a new string. 

The ranges definitions follow the definitions for the {\bf word()}{\rm (p.\,\pageref{classKStringHandler_e0})} function.

\begin{itemize}
\item \char`\"{}0\char`\"{} removes the very first word \item \char`\"{}0:\char`\"{} removes the first the the last word \item \char`\"{}0:3\char`\"{} removes the first to fourth words \item \char`\"{}:3\char`\"{} removes everything up to the fourth word \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the original text \item[{\em range}]the words to remove (see description) \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}
\end{itemize}


Definition at line 146 of file kstringhandler.cpp.

References QString::ascii(), QString::find(), QString::is\-Empty(), QString\-List::join(), QString::left(), QString::remove(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!remword@{remword}}
\index{remword@{remword}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::remword (const {\bf QString} \& {\em text}, uint {\em pos})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e5}


Removes a word at the given index, and returns a new string. 

The first index is zero (0). \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the original text \item[{\em pos}]the position (in words) of thw word to delete \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 207 of file kstringhandler.cpp.

References QString::is\-Empty(), QString\-List::join(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!remword@{remword}}
\index{remword@{remword}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::remword (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em word})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e6}


Removes a matching word from the string, and returns a new string. 

Note that only ONE match is removed. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the original text \item[{\em word}]the word to remove \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 224 of file kstringhandler.cpp.

References QString::is\-Empty(), QString\-List::join(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!capwords@{capwords}}
\index{capwords@{capwords}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::capwords (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e7}


Capitalizes each word in the string \char`\"{}hello there\char`\"{} becomes \char`\"{}Hello There\char`\"{} (string). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text to capitalize \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 249 of file kstringhandler.cpp.

References QString::is\-Empty(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!capwords@{capwords}}
\index{capwords@{capwords}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KString\-Handler::capwords (const {\bf QString\-List} \& {\em list})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e8}


Capitalizes each word in the list [hello, there] becomes [Hello, There] (list). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]the list to capitalize \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting list \end{Desc}


Definition at line 261 of file kstringhandler.cpp.

References QString::left(), QString::remove(), and word().\index{KStringHandler@{KString\-Handler}!reverse@{reverse}}
\index{reverse@{reverse}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::reverse (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e9}


Reverses the order of the words in a string \char`\"{}hello there\char`\"{} becomes \char`\"{}there hello\char`\"{} (string). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text to reverse \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 285 of file kstringhandler.cpp.

References QString::is\-Empty(), QString\-List::join(), and QString\-List::split().\index{KStringHandler@{KString\-Handler}!reverse@{reverse}}
\index{reverse@{reverse}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KString\-Handler::reverse (const {\bf QString\-List} \& {\em list})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e10}


Reverses the order of the words in a list [hello, there] becomes [there, hello] (list). 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em list}]the list to reverse \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting list \end{Desc}


Definition at line 299 of file kstringhandler.cpp.\index{KStringHandler@{KString\-Handler}!ljust@{ljust}}
\index{ljust@{ljust}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::ljust (const {\bf QString} \& {\em text}, uint {\em width})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e11}


Left-justifies a string and returns a string at least 'width' characters wide. 

If the string is longer than the {\tt width}, the original string is returned. It is never truncated. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text to justify \item[{\em width}]the desired width of the new string \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 317 of file kstringhandler.cpp.

References QString::append(), QString::length(), and QString::strip\-White\-Space().\index{KStringHandler@{KString\-Handler}!rjust@{rjust}}
\index{rjust@{rjust}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::rjust (const {\bf QString} \& {\em text}, uint {\em width})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e12}


Right-justifies a string and returns a string at least 'width' characters wide. 

If the string is longer than the {\tt width}, the original string is returned. It is never truncated. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text to justify \item[{\em width}]the desired width of the new string \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 331 of file kstringhandler.cpp.

References QString::length(), QString::prepend(), and QString::strip\-White\-Space().\index{KStringHandler@{KString\-Handler}!center@{center}}
\index{center@{center}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::center (const {\bf QString} \& {\em text}, uint {\em width})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e13}


Centers a string and returns a string at least 'width' characters wide. 

If the string is longer than the {\tt width}, the original string is returned. It is never truncated. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the text to justify \item[{\em width}]the desired width of the new string \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting string \end{Desc}


Definition at line 345 of file kstringhandler.cpp.

References QString::append(), QString::length(), QString::prepend(), and QString::strip\-White\-Space().\index{KStringHandler@{KString\-Handler}!lsqueeze@{lsqueeze}}
\index{lsqueeze@{lsqueeze}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::lsqueeze (const {\bf QString} \& {\em str}, uint {\em maxlen} = 40)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e14}


Substitute characters at the beginning of a string by \char`\"{}...\char`\"{}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]is the string to modify \item[{\em maxlen}]is the maximum length the modified string will have If the original string is shorter than \char`\"{}maxlen\char`\"{}, it is returned verbatim \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the modified string \end{Desc}


Definition at line 373 of file kstringhandler.cpp.

References QString::length(), and QString::right().\index{KStringHandler@{KString\-Handler}!csqueeze@{csqueeze}}
\index{csqueeze@{csqueeze}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::csqueeze (const {\bf QString} \& {\em str}, uint {\em maxlen} = 40)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e15}


Substitute characters at the middle of a string by \char`\"{}...\char`\"{}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]is the string to modify \item[{\em maxlen}]is the maximum length the modified string will have If the original string is shorter than \char`\"{}maxlen\char`\"{}, it is returned verbatim \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the modified string \end{Desc}


Definition at line 382 of file kstringhandler.cpp.

References QString::left(), QString::length(), and QString::right().\index{KStringHandler@{KString\-Handler}!rsqueeze@{rsqueeze}}
\index{rsqueeze@{rsqueeze}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::rsqueeze (const {\bf QString} \& {\em str}, uint {\em maxlen} = 40)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e16}


Substitute characters at the end of a string by \char`\"{}...\char`\"{}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em str}]is the string to modify \item[{\em maxlen}]is the maximum length the modified string will have If the original string is shorter than \char`\"{}maxlen\char`\"{}, it is returned verbatim \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the modified string \end{Desc}


Definition at line 391 of file kstringhandler.cpp.

References QString::left(), and QString::length().\index{KStringHandler@{KString\-Handler}!matchFileName@{matchFileName}}
\index{matchFileName@{matchFileName}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KString\-Handler::match\-File\-Name (const {\bf QString} \& {\em filename}, const {\bf QString} \& {\em pattern})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e17}


Match a filename. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]is the real decoded filename (or dirname without trailing '/'). \item[{\em pattern}]is a pattern like $\ast$.txt, $\ast$.tar.gz, Makefile.$\ast$, etc. Patterns with two asterisks like \char`\"{}$\ast$.$\ast$pk\char`\"{} are not supported. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the given filename matches the given pattern \end{Desc}


Definition at line 402 of file kstringhandler.cpp.

References QString::length(), and QString::unicode().

Referenced by match\-Filename().\index{KStringHandler@{KString\-Handler}!perlSplit@{perlSplit}}
\index{perlSplit@{perlSplit}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KString\-Handler::perl\-Split (const {\bf QString} \& {\em sep}, const {\bf QString} \& {\em s}, uint {\em max} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e18}


Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. 

If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.

Example: \small\begin{alltt}
 perlSplit("\_\_", "some\_\_string\_\_for\_\_you\_\_here", 4)
 {\bf QStringList} contains: "some", "string", "for", "you\_\_here"
 \end{alltt}\normalsize 


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sep}]is the string to use to delimit s. \item[{\em max}]is the maximum number of extractions to perform, or 0. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A {\bf QString\-List} containing tokens extracted from s. \end{Desc}


Definition at line 436 of file kstringhandler.cpp.

References QString::find(), QString::length(), and QString::mid().\index{KStringHandler@{KString\-Handler}!perlSplit@{perlSplit}}
\index{perlSplit@{perlSplit}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KString\-Handler::perl\-Split (const {\bf QChar} \& {\em sep}, const {\bf QString} \& {\em s}, uint {\em max} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e19}


Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. 

If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.

Example: \small\begin{alltt}
 perlSplit(' ', "kparts reaches the parts other parts can't", 3)
 {\bf QStringList} contains: "kparts", "reaches", "the pats other parts can't"
 \end{alltt}\normalsize 


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sep}]is the character to use to delimit s. \item[{\em max}]is the maximum number of extractions to perform, or 0. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A {\bf QString\-List} containing tokens extracted from s. \end{Desc}


Definition at line 462 of file kstringhandler.cpp.

References QString::find(), QString::length(), and QString::mid().\index{KStringHandler@{KString\-Handler}!perlSplit@{perlSplit}}
\index{perlSplit@{perlSplit}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KString\-Handler::perl\-Split (const {\bf QReg\-Exp} \& {\em sep}, const {\bf QString} \& {\em s}, uint {\em max} = 0)\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e20}


Split a {\bf QString} into a {\bf QString\-List} in a similar fashion to the static {\bf QString\-List} function in {\bf Qt}, except you can specify a maximum number of tokens. 

If max is specified (!= 0) then only that number of tokens will be extracted. The final token will be the remainder of the string.

Example: \small\begin{alltt}
 perlSplit({\bf QRegExp}("[! ]", "Split me up ! I'm bored ! OK ?", 3)
 {\bf QStringList} contains: "Split", "me", "up ! I'm bored, OK ?"
 \end{alltt}\normalsize 


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em sep}]is the regular expression to use to delimit s. \item[{\em max}]is the maximum number of extractions to perform, or 0. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A {\bf QString\-List} containing tokens extracted from s. \end{Desc}


Definition at line 488 of file kstringhandler.cpp.

References QString::length(), QReg\-Exp::matched\-Length(), QString::mid(), and QReg\-Exp::search().\index{KStringHandler@{KString\-Handler}!tagURLs@{tagURLs}}
\index{tagURLs@{tagURLs}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KString\-Handler::tag\-URLs (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [static]}}\label{classKStringHandler_e21}


This method auto-detects URLs in strings, and adds HTML markup to them so that richtext or HTML-enabled widgets (such as {\bf KActive\-Label}) will display the URL correctly. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]the string which may contain URLs \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the resulting text \end{Desc}
\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 515 of file kstringhandler.cpp.

References QString::length(), QReg\-Exp::matched\-Length(), QString::mid(), QString::replace(), and QReg\-Exp::search().\index{KStringHandler@{KString\-Handler}!matchFilename@{matchFilename}}
\index{matchFilename@{matchFilename}!KStringHandler@{KString\-Handler}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KString\-Handler::match\-Filename (const {\bf QString} \& {\em filename}, const {\bf QString} \& {\em pattern})\hspace{0.3cm}{\tt  [inline, static]}}\label{classKStringHandler_e22}


{\bf This class or method is obsolete, it is provided for compatibility only.} Use 

\begin{Desc}
\item[See also:]{\bf match\-File\-Name}{\rm (p.\,\pageref{classKStringHandler_e17})} () instead. \end{Desc}


Definition at line 310 of file kstringhandler.h.

References match\-File\-Name().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kstringhandler.h\item 
kstringhandler.cpp\end{CompactItemize}
