Jump to content

Recommended Posts

Posted

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..

Posted

$text = "Hello, I'm Kurt"

$1a = StringSplit($text, " ")

Msgbox(0,"",$1a[0]-1 & " spaces")

Who needs puzzles when we have AutoIt!!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...