3

I am trying to use split() function in QStringList

I have such a file;

41761505526;31.8
55201481028;69.5
26458795084;14.2
26410796678;29.4

I want to split those numbers like;

    41761505526     31.8
    55201481028     69.5
    26458795084     14.2
    26410796678     29.4

However I dont know how to use split function with 2 delimeter.

If I use;

strList = str.split(";");

Then it will show like

    41761505526
31.855201481028
69.526458795084
14.226410796678
29.4

I used str.split("\\W+"); it works not bad however not it is also splitting (.) dat char too. What is the most suitable way to split more than one delimeter ?

ymoreau
  • 3,402
  • 1
  • 22
  • 60
goGud
  • 4,163
  • 11
  • 39
  • 63

0 Answers0