I need to split a qstring into two strings but knowing only the index of the splitter charachter. Here’s an exaple
input:
PineApple
3
Output:
Pine // 'e' has index 3, so it is the splitter char and it belongs to the first part
Apple
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand your question correctly, you could use the
leftandmidmethods to extract the portions of the string before and after anoffset:If you’re looking to end up with a
QStringList(as you would have if you’d usedsplit), you can obtain one like so: