I
I
igoodmood2016-04-20 09:14:13
C++ / C#
igoodmood, 2016-04-20 09:14:13

How to split a string into 2 substrings in C++?

Recently I began to study strings myself and in the process of studying one question appeared: "In what way can one string be divided into two substrings?" I know there is a "String.Split" method, but it splits each word into a substring. Is it possible to somehow make the comma be the identifier for creating a new substring? I will be glad to read the answers.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2016-04-20
@res2001

Here is a whole bunch of split recipes:
stackoverflow.com/questions/236129/split-a-string-in-c
There is no split method in std::string as far as I know. You may be using a String object that is not in the standard library.

M
Maxim Moseychuk, 2016-04-20
@fshp

www.boost.org/doc/libs/1_57_0/doc/html/string_algo...
www.boost.org/doc/libs/1_57_0/doc/html/string_algo...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question