How to split items in a string separated by “,”

后端 未结 6 1416
栀梦
栀梦 2021-01-03 02:33

In my App, data comes in String like this

\"Hi,Hello,Bye\"

I want to separate data by \",\"

How can I do that?

6条回答
  •  温柔的废话
    2021-01-03 03:34

    If it's NSString, you can use componentsSeparatedByString.

    If it's std::string, you can iterate looking for the item (using find_frst_of and substr)

提交回复
热议问题