Splitting a string by a character

前端 未结 8 958
夕颜
夕颜 2020-11-27 05:18

I know this is a quite easy problem but I just want to solve it for myself once and for all

I would simply like to split a string into an array using a character as

8条回答
  •  难免孤独
    2020-11-27 05:54

    Is there a reason you don't want to convert a string to a character array (char*) ? It's rather easy to call .c_str(). You can also use a loop and the .find() function.

    string class
    string .find()
    string .c_str()

提交回复
热议问题