AutoHotkey Community

It is currently May 26th, 2012, 8:00 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: July 10th, 2009, 2:15 am 
Offline

Joined: January 20th, 2007, 7:47 pm
Posts: 110
I want to find out if there's a comma in a string.
`, didn't seem to work

thanks!

_________________
...Ed


Report this post
Top
 Profile  
Reply with quote  
PostPosted: July 10th, 2009, 2:20 am 
Use a variable. e.g

Code:
var = ,
string = lol, lol
IfInString, string, %var%
{
MsgBox, yes
}
else
{
MsgBox, no
}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2009, 2:41 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Escaping the comma works fine for me:

Code:
string = lol, lol
IfInString, string, `,
  MsgBox, yes

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2009, 6:04 am 
sinkfaze wrote:
Escaping the comma works fine for me:

Code:
string = lol, lol
IfInString, string, `,
  MsgBox, yes


I suppose, but the variable method is just another way of doing it if he can't get it right.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2009, 7:41 am 
Offline

Joined: June 24th, 2008, 8:30 am
Posts: 126
Quote:
Escaping the comma works fine for me:


Me too.


There is no reason to have extra code. I hate messy code...

_________________
“Whenever I'm about to do something, I think, 'Would an idiot do that?' And if they would, I do not do that thing.”

-Dwight


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, joetazz, Retro Gamer, wolverineks and 63 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group