| |

VerySource

 Forgot password?
 Register
Search
View: 649|Reply: 2

Beginner :: how to achieve this cycle

[Copy link]

5

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-3-15 21:00:01
| Show all posts |Read mode
A string str = "ab # c # .... # de"

#The number of preceding strings is indefinite

How can I store the characters before # in an Array
int i = 0;
CString stri; ????
CStringArray StrArray;

AfxExtractSubString (stri, (LPCTSTR) str, i, '#');
StrArray.Add (stri);
i ++; ????
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-6-15 18:15:02
| Show all posts
int i;
CString str, str1;

i = str.Find("#");
str1 = str.Left(i);
StrArray.Add(str1);
Reply

Use magic Report

5

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 Unknown

 Author| Post time: 2020-6-17 15:15:01
| Show all posts
Thank you so much!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list