Re: Substring with unknown length (newbie)



Take a look at delphis help for strings

this might work:

Result := Copy(InputStr, 1, Pos('>', InputStr));

Pos will return the position needed, and in Copy here it is the length.
Take a look at the help for those 2. Also, there is one function to
compare Ansi strings, but that is probably somehwere in the help

S

.



Relevant Pages

  • Re: Best way to update html tag
    ... "Tom Corcoran" wrote in message ... > a html parser component, I guess one could use one of the xml/dom ones ... Pos works on plain text, ... works much better on simple long strings. ...
    (comp.lang.pascal.delphi.misc)
  • Re: HyperStr
    ... For long strings, such effort is well worth it. ... such effort is probably a waste of time. ... My typical Pos use is for a single character in about 10 ...
    (borland.public.delphi.thirdpartytools.general)
  • Counting Chars Within Strings
    ... Alright a couple of stupid questions here about strings and Chars. ... public class CountVowels ... pos = String1.charAt; ...
    (comp.lang.java.programmer)
  • Suggestion for PosEx replacement
    ... Have another parameter with a End pos. ... When parsing ... huge strings that is quite useful. ... reading XML documents many megabytes in size. ...
    (borland.public.delphi.language.basm)
  • Problems with InvokeMember()
    ... The example from MSDN works fine for strings,but it's not working for ... primitives like 'double' ... Type mtype = m.GetType; ... Prev by Date: ...
    (microsoft.public.dotnet.csharp.general)