![]() |
extract string from string
how can we extract Strings From String
myString :='Age:16' +'Name:molley' +'Country:Austria'; i want to extract the values of Age, Name , Country edit1.text:=16; edit2.text:=molley; edit3.text:=Austria; |
Re: extract string from string
Pos()/PosEx() + Copy()
With a StringList (.DelimitedText) |
Re: extract string from string
Hi,
have a look at NameValueSeparator:
Delphi-Quellcode:
Regards
begin
myString := 'Age:16' + sLineBreak + 'Name:molley' + sLineBreak + 'Country:Austria'; with TStringList.Create do try Text := myString; NameValueSeparator := ':'; edit1.text := Values['Age']; edit2.text := Values['Name']; edit3.text := Values['Country']; finally Free; end; end; |
Re: extract string from string
Hi,
it would work only, when you add #13 at the end of the lines. myString :='Age:16' + #13 +'Name:molley' + #13 +'Country:Austria'; |
Re: extract string from string
#13 is part of sLineBreak
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:07 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz