Delimiting character in QString.readLine()
General and Desktop
4
Posts
3
Posters
7.6k
Views
1
Watching
-
wrote on 23 Apr 2012, 22:32 last edited by
@istream& getline (char* s, streamsize n, char delim );@
How can I use a delimiting character as argument when dealing with QStrings?
readLine() only takes maximum allowed line length as argument so I have to walk around? -
wrote on 24 Apr 2012, 00:03 last edited by
Sorry for my poor English, I do not understand what you want to express. what is QString.readLine() ?
Debao
-
wrote on 24 Apr 2012, 00:24 last edited by
I think that QString does not have a readLine() method.
The QTextStream class does have a readLine() method which returns a QString.
It will read one line from the stream. The end of the line can be any of these:
- The maximum number of characters has been read
- A line break has been encountered
- The end of the stream (file) has been reached
If you want to split a QString with user-defined delimiters, use QString::split() instead ;)
-
wrote on 24 Apr 2012, 11:38 last edited by
Yes, split() is indeed the function I am looking for, thanks!
1/4