 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jitendravyas
Joined: 06 Mar 2010 Posts: 15 Location: India
|
|
| Back to top |
|
 |
MasterFocus
Joined: 08 Apr 2009 Posts: 3035 Location: Rio de Janeiro - RJ - Brasil
|
Posted: Tue Mar 16, 2010 7:06 pm Post subject: |
|
|
Something like this?
| Code: | | NewString := RegExReplace(OldString,"\s+"," ") |
_________________ "Read the manual. Read it again. Search the forum.
Try something before asking. Show what you've tried."
Antonio França
My stuff: Google Profile |
|
| Back to top |
|
 |
maxgohan
Joined: 09 Oct 2009 Posts: 81
|
Posted: Wed Mar 17, 2010 2:17 pm Post subject: |
|
|
you can do it with a StringReplace however i don't know what the value is for line breaks
| Quote: |
; Replace all spaces with pluses:
StringReplace, NewStr, OldStr, %A_SPACE%, +, All
|
|
|
| Back to top |
|
 |
maxgohan
Joined: 09 Oct 2009 Posts: 81
|
Posted: Wed Mar 17, 2010 2:25 pm Post subject: |
|
|
k it should be something like
| Quote: |
StringReplace, NewStr, OldStr, `r`n, , All
|
try that |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 780 Location: England
|
Posted: Wed Mar 17, 2010 2:53 pm Post subject: |
|
|
Not the most elegant solution, but try the below. It seems to have the same results as that tool you linked for me.
| Code: | String =
(
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam elementum ipsu
murna. Maecenas adipiscing, odio at commodo sollicitudin, turpis nisl pellent
esque nisl, a semper erat tellus sed tortor. Vivamus turpis dui, varius in eg
estas sit amet, vulputate a augue. Nam vulputate diam vel nisl faucibus laore
et aliquam leo aliquet.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac
turpis egestas. Pellentesque habitant morbi tristique senectus et netus et ma
lesuada fames ac turpis egestas. Sed sed augue lectus. In condimentum convall
is elit, ut tempus quam ullamcorper id.
Proin eget varius nibh. Nunc tincidunt convallis pharetra. Nunc viverra tellu
s in libero consectetur pharetra tempus felis posuere. Donec consequat pellen
tesque laoreet. Proin rhoncus magna rhoncus nibh tristique fermentum.
)
MsgBox, BEFORE`n`n%String%
StringReplace, String, String, `n`n,||,All
StringReplace, String, String, `n,, All
StringReplace, String, String, ||,`n`n,All
MsgBox, AFTER`n`n%String% |
|
|
| 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
|