_Kurt Posted December 16, 2006 Share Posted December 16, 2006 Hey, I've figured out a way to see how many spaces there are in $text, but it seems to take quite some time. I was wondering if there could be any other way. Here is my example for my solution: $text = "Hello, I'm Kurt" $1a = StringSplit($text, " ") If StringInStr($text, " ") Then If $text = $1a[1] & " " & $1a[2] Then Msgbox(0,"","2 words") Else If $text = $1a[1] & " " & $1a[2] & " " & $1a[3] Then Msgbox(0,"","3 words") Else Msgbox(0,"","4 words, And so on..") EndIf EndIf Else Msgbox(0,"","One Word") EndIf Any ideas? Thanks, Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Valuater Posted December 16, 2006 Share Posted December 16, 2006 maybe.... $text = " Hello, I'm Kurt " $ntext = StringReplace($text, " ", "") MsgBox(0x0, "Spaces", @extended) 8) Link to comment Share on other sites More sharing options...
Rick Posted December 16, 2006 Share Posted December 16, 2006 $text = "Hello, I'm Kurt" $1a = StringSplit($text, " ") Msgbox(0,"",$1a[0]-1 & " spaces") Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
_Kurt Posted December 16, 2006 Author Share Posted December 16, 2006 Thanks for your help, guys! Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now