Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-11

Removing a character from string

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author
to Richard Mace
Richard Mace wrote
Hi all, I was sure there was a function to do this, but I can't seem to find it. How would I remove a character from a string?

if P is the position:

Delete(S,p,1);

Note that if S is an UTF-8 string, and at p there is a unicode control code, this will give unexpected results...

Michael.

Reply by email

bsquared
to Richard Mace: I was sure there was a function to do this, but I can't seem to find it. How would I…
Richard Mace wrote 16 lines
Hi all, I was sure there was a function to do this, but I can't seem to find it. How would I remove a character from a string? Many thanks Richard -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

StringReplace using EmptyStr as the replacement is one way.

Regards, Brian

Reply by email

Richard Mace
to Unknown author: if P is the position: Delete(S,p,1); Note that if S is an UTF-8 string, and at p there is…

Michael,
Thanks.
What would be the best way of finding the position of char in a string (Windows only)

Thanks

Richard

*Richard Mace*

*Are you interested in an additional income working part time and without affecting what you already do?* Then watch this
3minutevideo.co.uk<http://www.3minutevideo.co.uk>

Show quoted text 24 lines
On Mon, 12 Nov 2012, Richard Mace wrote: Hi all, > I was sure there was a function to do this, but I can't seem to find it. > How would I remove a character from a string? > if P is the position: Delete(S,p,1); Note that if S is an UTF-8 string, and at p there is a unicode control code, this will give unexpected results... Michael. -- ______________________________**_________________ Lazarus mailing list .**freepascal.org http://lists.lazarus.**freepascal.org/mailman/**listinfo/lazarus<http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20121112/fb335e83/attachment.html>

Reply by email