Home > Back-end >  C to identify comma-separated data
C to identify comma-separated data

Time:10-09

Has a group of number, such as:
1, 2, 3
2 and 4
4 and 6
.
A total of n group
Read a [] [] [] the three-dimensional array, how to do ah, turn a great god...

CodePudding user response:

With a TStringList read
String: XXXX XXXX XXXX XXXX XXXX XXXXX

Methods: using TStringList

Void __fastcall TForm1: : btn1Click (TObject * Sender)
{
String str_tmp;
Str_tmp="1000001 asdfas akzo to asdf123 said as132";//character between separated by a Tab
TStringList * StrLst=new TStringList;
StrLst - & gt; Delimiter='\ t';//'interval between characters such as this example TAB use \ t
StrLst - & gt; DelimitedText=str_tmp;
for(int i=0; I & lt; StrLst - & gt; The Count. I++)
{
Mmo1 - & gt; Lines - & gt; Add (StrLst - & gt; Strings [I]);
}
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
1000001
Asdfas
Aksu in
Asdf123
Said as132
  • Related