Hallo,
weiß jemand wie ich einen String in genau 2 Teile splitten kann?
Bsp:
Ich will folgenden String splitten: "123456:1233456:123456".
Er soll aber so gesplittet werden, dass nur beim ersten gefundenen Doppelpunkt in 2 Teile gespittet wird und nicht bei jedem Doppelpunkt (mit .split() habe ich es schon versucht, hat aber nicht funktioniert).
QString split
API lesen .. das bildet:
http://doc.qt.nokia.com/stable/qstring.html
Die helfen dir weiter ... versuchs mit 2,-1
ausserdem gibts noch mid zu denen die franzf schon nannte ...
http://doc.qt.nokia.com/stable/qstring.html
Code: Alles auswählen
QString section ( QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault ) const
QString section ( const QString & sep, int start, int end = -1, SectionFlags flags = SectionDefault ) const
QString section ( const QRegExp & reg, int start, int end = -1, SectionFlags flags = SectionDefault ) constausserdem gibts noch mid zu denen die franzf schon nannte ...