Hi
Say I have a string "TopBanana"
What is the best way to split it into two strings "Top" and "Banana"
I tried with QRegExp but i dont think im using it correctly
Qt Code:
To copy to clipboard, switch view to plain text mode
TIA
Graham
Hi
Say I have a string "TopBanana"
What is the best way to split it into two strings "Top" and "Banana"
I tried with QRegExp but i dont think im using it correctly
Qt Code:
To copy to clipboard, switch view to plain text mode
TIA
Graham
is "[A-Z}" a typo?
Didn't you mean "[A-Z]"?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
You wrote QRegExp("[A-Z}"); - it should be QRegExp("[A-Z]");
You can try this:
Qt Code:
s.replace(re1, ";\\1\\2");To copy to clipboard, switch view to plain text mode
GrahamLabdon (2nd February 2011)
beside the typo, you have to use a positive lookahead:Qt Code:
To copy to clipboard, switch view to plain text mode
Hi thanks
This solution works but the split gives me 3 strings in the list the first of which is empty
GrahamLabdon (2nd February 2011)
Bookmarks