Topic: Having split function in string library


Author: Radium Sharma <radium.sharma06@gmail.com>
Date: Mon, 25 Feb 2019 00:24:06 -0800 (PST)
Raw View
------=_Part_494_2028061415.1551083046779
Content-Type: multipart/alternative;
 boundary="----=_Part_495_691986380.1551083046780"

------=_Part_495_691986380.1551083046780
Content-Type: text/plain; charset="UTF-8"

Hi all,
I thought we should have a split function of string like other languages so
thought of proposing an idea.
Following is the implementation for having a split function in c++ string
module like other languages.
Function signature  -   vector<string> split(string s, char delimiter);
The function should take a string which should be splitted as first
argument and a delimiter which will decide based on what it should split
like (',',' ').
It should return a vector of strings which are splitted based on the
deimiter.
Following is the function code :-

vector<string> split(string s, char delimiter){

int n = s.length(), k=0;

vector<string> v;

for(int i=0;i<n;i++){

if(s[i]==delimiter){

string x = s.substr(k,i-k);

k=i+1;

v.push_back(x);

} else if(i==n-1){

string x = s.substr(k,i-k+1);

v.push_back(x);

}

}

return v;
}

Regards
Radium

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7%40isocpp.org.

------=_Part_495_691986380.1551083046780
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi all,</div><div>I thought we should have a split fu=
nction of string like other languages so thought of proposing an idea.</div=
>Following is the implementation for having a split function in c++ string =
module like other languages.=C2=A0<div>Function signature=C2=A0 -=C2=A0 =C2=
=A0vector&lt;string&gt; split(string s, char delimiter);</div><div>The func=
tion should take a string which should be splitted as first argument and a =
delimiter which will decide based on what it should split like (&#39;,&#39;=
,&#39; &#39;).</div><div>It should return a vector of strings which are spl=
itted based on the deimiter.</div><div>Following is the function code :-</d=
iv><div><br></div>




<style type=3D"text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Helvetica Neue'}
span.Apple-tab-span {white-space:pre}
</style>


<p class=3D"p1">vector&lt;string&gt; split(string s, char delimiter){</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span>int n =3D s.length()=
, k=3D0;</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span>vector&lt;string&gt;=
 v;</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span>for(int i=3D0;i&lt;n=
;i++){</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span>if(s[i]=3D=3Ddelimiter){</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span><span class=3D"Apple-tab-span"> </span>string x =3D s.su=
bstr(k,i-k);</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span><span class=3D"Apple-tab-span"> </span>k=3Di+1;</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span><span class=3D"Apple-tab-span"> </span>v.push_back(x);</=
p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span>} else if(i=3D=3Dn-1){</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span><span class=3D"Apple-tab-span"> </span>string x =3D s.su=
bstr(k,i-k+1);</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span><span class=3D"Apple-tab-span"> </span>v.push_back(x);</=
p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span><span class=3D"Apple=
-tab-span"> </span>}</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span>}</p>
<p class=3D"p1"><span class=3D"Apple-tab-span"> </span>return v;</p>
<div><span style=3D"font-family: &quot;Helvetica Neue&quot;; font-size: 12p=
x;">}</span></div><div><br></div><div>Regards</div><div>Radium</div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7=
%40isocpp.org</a>.<br />

------=_Part_495_691986380.1551083046780--

------=_Part_494_2028061415.1551083046779--

.


Author: Ren Industries <renindustries@gmail.com>
Date: Mon, 25 Feb 2019 10:24:30 -0500
Raw View
--0000000000001ea60e0582b98a14
Content-Type: text/plain; charset="UTF-8"

Why would we copy all these strings when std::string_view exists?

On Mon, Feb 25, 2019 at 3:24 AM Radium Sharma <radium.sharma06@gmail.com>
wrote:

> Hi all,
> I thought we should have a split function of string like other languages
> so thought of proposing an idea.
> Following is the implementation for having a split function in c++ string
> module like other languages.
> Function signature  -   vector<string> split(string s, char delimiter);
> The function should take a string which should be splitted as first
> argument and a delimiter which will decide based on what it should split
> like (',',' ').
> It should return a vector of strings which are splitted based on the
> deimiter.
> Following is the function code :-
>
> vector<string> split(string s, char delimiter){
>
> int n = s.length(), k=0;
>
> vector<string> v;
>
> for(int i=0;i<n;i++){
>
> if(s[i]==delimiter){
>
> string x = s.substr(k,i-k);
>
> k=i+1;
>
> v.push_back(x);
>
> } else if(i==n-1){
>
> string x = s.substr(k,i-k+1);
>
> v.push_back(x);
>
> }
>
> }
>
> return v;
> }
>
> Regards
> Radium
>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit
> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMD6iD-BU91WrUH9rOZv8CE%3DQ7EG7MWMYpb1Gh8csFX7x_N%2BaA%40mail.gmail.com.

--0000000000001ea60e0582b98a14
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Why would we copy all these strings when std::string_view =
exists?</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Mon, Feb 25, 2019 at 3:24 AM Radium Sharma &lt;<a href=3D"mailto:=
radium.sharma06@gmail.com">radium.sharma06@gmail.com</a>&gt; wrote:<br></di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div>H=
i all,</div><div>I thought we should have a split function of string like o=
ther languages so thought of proposing an idea.</div>Following is the imple=
mentation for having a split function in c++ string module like other langu=
ages.=C2=A0<div>Function signature=C2=A0 -=C2=A0 =C2=A0vector&lt;string&gt;=
 split(string s, char delimiter);</div><div>The function should take a stri=
ng which should be splitted as first argument and a delimiter which will de=
cide based on what it should split like (&#39;,&#39;,&#39; &#39;).</div><di=
v>It should return a vector of strings which are splitted based on the deim=
iter.</div><div>Following is the function code :-</div><div><br></div>







<p class=3D"gmail-m_2088857348569613176p1">vector&lt;string&gt; split(strin=
g s, char delimiter){</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span>int n =3D s.length(), k=3D0;</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span>vector&lt;string&gt; v;</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span>for(int i=3D0;i&lt;n;i++){</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span>if(s[i]=3D=3Ddelimiter){</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span><span class=3D"gmail-m_2088857348569613176Apple-ta=
b-span"> </span>string x =3D s.substr(k,i-k);</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span><span class=3D"gmail-m_2088857348569613176Apple-ta=
b-span"> </span>k=3Di+1;</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span><span class=3D"gmail-m_2088857348569613176Apple-ta=
b-span"> </span>v.push_back(x);</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span>} else if(i=3D=3Dn-1){</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span><span class=3D"gmail-m_2088857348569613176Apple-ta=
b-span"> </span>string x =3D s.substr(k,i-k+1);</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span><span class=3D"gmail-m_2088857348569613176Apple-ta=
b-span"> </span>v.push_back(x);</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span><span class=3D"gmail-m_208885734856961317=
6Apple-tab-span"> </span>}</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span>}</p>
<p class=3D"gmail-m_2088857348569613176p1"><span class=3D"gmail-m_208885734=
8569613176Apple-tab-span"> </span>return v;</p>
<div><span style=3D"font-family:&quot;Helvetica Neue&quot;;font-size:12px">=
}</span></div><div><br></div><div>Regards</div><div>Radium</div></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-4247-8da8-3e7b4d62bed7%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5a8125fc-82bd-=
4247-8da8-3e7b4d62bed7%40isocpp.org</a>.<br>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAMD6iD-BU91WrUH9rOZv8CE%3DQ7EG7MWMYp=
b1Gh8csFX7x_N%2BaA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAMD6iD-BU91W=
rUH9rOZv8CE%3DQ7EG7MWMYpb1Gh8csFX7x_N%2BaA%40mail.gmail.com</a>.<br />

--0000000000001ea60e0582b98a14--

.


Author: Cleiton Santoia <cleitonsantoia@gmail.com>
Date: Wed, 6 Mar 2019 07:04:47 -0800 (PST)
Raw View
------=_Part_273_1695794130.1551884687640
Content-Type: multipart/alternative;
 boundary="----=_Part_274_1679689333.1551884687641"

------=_Part_274_1679689333.1551884687641
Content-Type: text/plain; charset="UTF-8"


You may implement this "generically", to work on other containers,
std::array, plain arrays, vector, etc...

template< class ForwardIt1, class ForwardIt2, class OutIt >
void split( ForwardIt1 first, ForwardIt1 last, ForwardIt2 s_first,
ForwardIt2 s_last, OutIt o ) { // 'o' may be anything
    auto sz = std::distance(s_first, s_last);
    auto next = first;
    while ( next != last ) {
        next = std::search(first, last, s_first, s_last);
        *o++ = { first, next } ; // <- copy elision guarantee that this is
moving ?
        first = next;
        std::advance(first, sz);
    }
}

have fun :)  https://coliru.stacked-crooked.com/a/a020522ddc01b8bc

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/4cb6662a-7718-441f-aa40-68af3c2b5f34%40isocpp.org.

------=_Part_274_1679689333.1551884687641
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br>You may implement this &quot;generically&quot;, to wor=
k on other containers, std::array, plain arrays, vector, etc...<br><div><br=
></div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250, =
250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-wi=
dth: 1px; overflow-wrap: break-word;"><code class=3D"prettyprint"><div clas=
s=3D"subprettyprint"><div class=3D"prettyprint" style=3D"border-color: rgb(=
187, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: brea=
k-word;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><div cla=
ss=3D"subprettyprint">template&lt; class ForwardIt1, class ForwardIt2, clas=
s OutIt &gt;</div><div class=3D"subprettyprint">void split( ForwardIt1 firs=
t, ForwardIt1 last, ForwardIt2 s_first, ForwardIt2 s_last, OutIt o ) { // &=
#39;o&#39; may be anything</div><div class=3D"subprettyprint">=C2=A0 =C2=A0=
 auto sz =3D std::distance(s_first, s_last);</div><div class=3D"subprettypr=
int">=C2=A0 =C2=A0 auto next =3D first;</div><div class=3D"subprettyprint">=
=C2=A0 =C2=A0 while ( next !=3D last ) {</div><div class=3D"subprettyprint"=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 next =3D std::search(first, last, s_first, s_l=
ast);</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 *o++ =
=3D { first, next } ; // &lt;- copy elision guarantee that this is moving ?=
</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 first =3D n=
ext;</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 =C2=A0 =C2=A0 std::ad=
vance(first, sz);</div><div class=3D"subprettyprint">=C2=A0 =C2=A0 }</div><=
div class=3D"subprettyprint">}</div></div></code></div></div></code></div><=
br>have fun :)=C2=A0=C2=A0<a href=3D"https://coliru.stacked-crooked.com/a/a=
020522ddc01b8bc">https://coliru.stacked-crooked.com/a/a020522ddc01b8bc</a><=
br></div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/4cb6662a-7718-441f-aa40-68af3c2b5f34%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4cb6662a-7718-441f-aa40-68af3c2b5f34=
%40isocpp.org</a>.<br />

------=_Part_274_1679689333.1551884687641--

------=_Part_273_1695794130.1551884687640--

.


Author: dosselmr@cs.uregina.ca
Date: Thu, 7 Mar 2019 08:13:55 -0800 (PST)
Raw View
------=_Part_842_721689532.1551975235957
Content-Type: multipart/alternative;
 boundary="----=_Part_843_1060114177.1551975235957"

------=_Part_843_1060114177.1551975235957
Content-Type: text/plain; charset="UTF-8"

This has seemingly been suggested already:

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0540r1.html


On Monday, February 25, 2019 at 2:24:06 AM UTC-6, Radium Sharma wrote:

> Hi all,
> I thought we should have a split function of string like other languages
> so thought of proposing an idea.
> Following is the implementation for having a split function in c++ string
> module like other languages.
> Function signature  -   vector<string> split(string s, char delimiter);
> The function should take a string which should be splitted as first
> argument and a delimiter which will decide based on what it should split
> like (',',' ').
> It should return a vector of strings which are splitted based on the
> deimiter.
> Following is the function code :-
>
> vector<string> split(string s, char delimiter){
>
> int n = s.length(), k=0;
>
> vector<string> v;
>
> for(int i=0;i<n;i++){
>
> if(s[i]==delimiter){
>
> string x = s.substr(k,i-k);
>
> k=i+1;
>
> v.push_back(x);
>
> } else if(i==n-1){
>
> string x = s.substr(k,i-k+1);
>
> v.push_back(x);
>
> }
>
> }
>
> return v;
> }
>
> Regards
> Radium
>

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/02fdd53c-4829-4fcf-81b8-58022efa0cec%40isocpp.org.

------=_Part_843_1060114177.1551975235957
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>This has seemingly been suggested already:</div><div>=
<br></div><div><a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/paper=
s/2018/p0540r1.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/201=
8/p0540r1.html</a></div><div><br><br>On Monday, February 25, 2019 at 2:24:0=
6 AM UTC-6, Radium Sharma wrote:</div><blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(=
204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><div>Hi all,</div><div>I thought we should have a split function o=
f string like other languages so thought of proposing an idea.</div>Followi=
ng is the implementation for having a split function in c++ string module l=
ike other languages.=C2=A0<div>Function signature=C2=A0 -=C2=A0 =C2=A0vecto=
r&lt;string&gt; split(string s, char delimiter);</div><div>The function sho=
uld take a string which should be splitted as first argument and a delimite=
r which will decide based on what it should split like (&#39;,&#39;,&#39; &=
#39;).</div><div>It should return a vector of strings which are splitted ba=
sed on the deimiter.</div><div>Following is the function code :-</div><div>=
<br></div>







<p>vector&lt;string&gt; split(string s, char delimiter){</p>
<p><span> </span>int n =3D s.length(), k=3D0;</p>
<p><span> </span>vector&lt;string&gt; v;</p>
<p><span> </span>for(int i=3D0;i&lt;n;i++){</p>
<p><span> </span><span> </span>if(s[i]=3D=3Ddelimiter){</p>
<p><span> </span><span> </span><span> </span>string x =3D s.substr(k,i-k);<=
/p>
<p><span> </span><span> </span><span> </span>k=3Di+1;</p>
<p><span> </span><span> </span><span> </span>v.push_back(x);</p>
<p><span> </span><span> </span>} else if(i=3D=3Dn-1){</p>
<p><span> </span><span> </span><span> </span>string x =3D s.substr(k,i-k+1)=
;</p>
<p><span> </span><span> </span><span> </span>v.push_back(x);</p>
<p><span> </span><span> </span>}</p>
<p><span> </span>}</p>
<p><span> </span>return v;</p>
<div><span style=3D"font-family: &quot;Helvetica Neue&quot;; font-size: 12p=
x;">}</span></div><div><br></div><div>Regards</div><div>Radium</div></div><=
/blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/02fdd53c-4829-4fcf-81b8-58022efa0cec%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/02fdd53c-4829-4fcf-81b8-58022efa0cec=
%40isocpp.org</a>.<br />

------=_Part_843_1060114177.1551975235957--

------=_Part_842_721689532.1551975235957--

.