 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
JGpo Guest
|
Posted: Fri Apr 29, 2005 6:34 pm Post subject: easy syntax question - StringReplace |
|
|
Does anyone know the proper way to replace a comma with a pipe ( | )using StringReplace? I've tried:
StringReplace, Var1, Var1, , , |,All
StringReplace, Var1, Var1, ', , |,All
StringReplace, Var1, Var1, ,%,% |,All
but nothing seems to work. Does anyone know the proper syntax? |
|
| Back to top |
|
 |
JGpo Guest
|
Posted: Fri Apr 29, 2005 6:56 pm Post subject: easy syntax question - StringReplace |
|
|
I figured it out, thanks all!
var1 = ,
msgbox %var1%
var2 = 234,21,2,3,24,1,32,4,1,2,3,4,2,12,32,4,2,2
stringreplace, var2, var2, %var1%, |,A
msgbox, %var2% |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Fri Apr 29, 2005 7:05 pm Post subject: |
|
|
the proper way to use a "literal comma" within an AHK command would be to escape it this way ...
| Quote: |
InputVar = 234,21,2,3,24,1,32,4,1,2,3,4,2,12,32,4,2,2
StringReplace, OutputVar, InputVar, `,, |, All
MsgBox, %OutputVar% |
Check the help for #EscapeChar  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|