0

how would i go about spliting a string that is stored in a StringList ?

information in string looks like this:

Name
RanK

now i need to split them so i can use a funcation like this

data[0] for Name
and
data[1] for rank

can sumone help me please?
thanks

3
Contributors
2
Replies
5
Views
6 Years
Discussion Span
Last Post by FlamingClaw
0

information in string looks like this:

Name
RanK

From this, I understand that the string looks like Name<CR><LF>Rank (Name#D#ARank). If you want to split it, use Pos and copy functions.

iPos := Pos('#13#10', yourString). 
Name := copy(yourString, 1, iPos-1);
Delete(yourString, 1, iPos + 1); //delete <CR><LF>
//now, yourString stores only the rank

If my supposition is wrong, post your code.

Cheers,
Ionut

0

how would i go about spliting a string that is stored in a StringList ?

information in string looks like this:

Name
RanK

now i need to split them so i can use a funcation like this

data[0] for Name
and
data[1] for rank

can sumone help me please?
thanks

Delphi-TStringList

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.