I want to split a QString
, but according to the documentation, the split function only allows for splitting whenever the character to split at occurs. What I want is to only split at the place where first time the character occurs.
For example:
5+6+7
wiht default split()
would end in a list containing ["5","6","7"]
what I want: a list with only two elements -> ["5","6+7"]
Thanks in advance for your answers!
indexOf
to find the first occurrence of"+"
. Then split the string usingmid
-mid(0,index)
andmid(index+1)
– Sarcocarp