Jump to content

Recommended Posts

Posted

Trying to figure out how to make a autoit script to have one input box that I can put

"FirstName Lastname" then I hit OK button

and it out puts the

"LastName FirstName" to another string.

Any help would be appreciated with this.

I want to reverse the two words in the input box.

Thank You

Rene

Posted

There is no reliable way to split a whole name. What if the persons name is Mary Ann O' Flannigan, or John Jacob Jingleheimer Schmidt?

Ask for first, middle and last names seperately.

$string = "FirstName Lastname"
$reversed = StringRegExpReplace($string,"\A(.*)\h(.*)\Z", "$2 $1")
MsgBox(0,"",$reversed)

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
×
×
  • Create New...