Is There A Built-In Way to Split Strings In C++?

前端 未结 10 2208
心在旅途
心在旅途 2020-12-08 10:56

well is there? by string i mean std::string

10条回答
  •  無奈伤痛
    2020-12-08 11:44

    void split(string StringToSplit, string Separators)
    {
        size_t EndPart1 = StringToSplit.find_first_of(Separators)
        string Part1 = StringToSplit.substr(0, EndPart1);
        string Part2 = StringToSplit.substr(EndPart1 + 1);
    }
    

提交回复
热议问题