Subject:
|
Re: Delphi Help Needed: Converting string to TStringList?
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Tue, 1 Oct 2002 18:10:27 GMT
|
Viewed:
|
799 times
|
| |
| |
"Tore Eriksson" <tore.eriksson@mbox325.swipnet.se> skrev i meddelandet
news:H3B9uK.Jo6@lugnet.com...
>
> strCompleteText: String;
> MyStringList: TStringList;
>
> How do I convert strCompleteText (containing LF's) into strings in
MyStringList?
MyStringList.Text := strCompleteText;
As long as you want one element in MyStringList for each LF-separated string
in strCompleteText, and nothing else.
The other way around (which I presume you've found?) is:
strCompleteText := MyStringList.Text;
While you're at it, read the help (or the source if you have it) on
TStringList.CommaText too, it can be very useful for quick and dirty
parsing, especially if you have Delphi 6 or later.
BTW, if you have the Delphi VCL source, take a look at SYSUTILS.PAS, there
are quite a lot of useful procedures and functions which are not documented
in the help.
Or look at 'HyperString' (can't remember the URL), it's a gigantic string
library, with quite fast routines.
As for really fast parsing, look at the SynEdit (mwEdit) code for syntax
highlighting - it's a bit tricky to understand, but it's _fast_
--
Anders Isaksson, Sweden
BlockCAD: http://user.tninet.se/~hbh828t/proglego.htm
Gallery: http://user.tninet.se/~hbh828t/gallery/index.htm
|
|
Message has 1 Reply:
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|