Recent

Author Topic: [SOLVED] - Need help with String  (Read 3315 times)

Takeda

  • Full Member
  • ***
  • Posts: 157
[SOLVED] - Need help with String
« on: July 28, 2011, 03:26:30 pm »
Hello..

I have a question..
The question is,
What should I do if I want to replace Single BackSlash ('\') with DoubleSlash ('\\') wherever inside the strings..

A String like this => abcd\1234\efghij\klmnopq\wwh
and I want to change it to be => abcd\\1234\\efghij\\klmnopq\wwh

I need help.. Please, help me..

Best Regards,
Takeda.
« Last Edit: July 28, 2011, 03:50:56 pm by Takeda »
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

Zoran

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Need help with String
« Reply #1 on: July 28, 2011, 03:35:38 pm »
You can use StringReplace function. This way:
Code: [Select]
S := StringReplace(S, '\', '\\', [rfReplaceAll]);
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

Takeda

  • Full Member
  • ***
  • Posts: 157
[SOLVED] - Need help with String
« Reply #2 on: July 28, 2011, 03:49:51 pm »
You can use StringReplace function. This way:
Code: [Select]
S := StringReplace(S, '\', '\\', [rfReplaceAll]);

Ok thank you very much, Sir..
It works..

I'm so happy.. :)
Call me Takeda coz that's my true name.
Pascal coding using Lazarus => "Be native in any where.."

ƪ(˘⌣˘)┐ ƪ(˘⌣˘)ʃ ┌(˘⌣˘)ʃ

 

TinyPortal © 2005-2018