AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Erasing Enter keys

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Sergio



Joined: 16 Mar 2008
Posts: 25
Location: Brooklyn

PostPosted: Sun Mar 30, 2008 7:51 am    Post subject: Erasing Enter keys Reply with quote

The following code removes a character (spaces) from a string of text on my clipboard
Code:
StringReplace, clipboard, clipboard, `r`n, , All


How would I remove 2 different characters from my text at once. Assuming those characters were a space, and enter?
_________________
Back to top
View user's profile Send private message
k3ph



Joined: 21 Jul 2006
Posts: 123

PostPosted: Sun Mar 30, 2008 9:26 am    Post subject: Reply with quote

well, in hex way:
space = 20
enter = 0D 0A

A = "this 'nis 'na 'ntest" (where 'n = new line)
Code:
EF BB BF 74 68 69 73 20 0D 0A 69 73 20 0D 0A 61 20 0D 0A 74 65 73 74


B = "this is a test"
Code:
EF BB BF 74 68 69 73 69 73 61 74 65 73 74


A -> B AHK example:
Code:
feed := "EF BB BF 74 68 69 73 20 0D 0A 69 73 20 0D 0A 61 20 0D 0A 74 65 73 74"
output:= RegExReplace(feed, "20 0D 0A ", "")

MsgBox %feed%`n%output%
return
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 556
Location: MN, USA

PostPosted: Sun Mar 30, 2008 9:41 pm    Post subject: Reply with quote

Code:
var := RegExReplace(var,"\s+")

_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group