Showing tag results for string manipulation

Jan 20, 2006
Post comments count0
Post likes count0

How Can I Extract a Series of Characters Found in the Middle of a String?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a series of strings that look something like this: xxxxyyyyyyxx. How can I extract just the y’s?-- JB Hey, JB. And, yes, it is a Friday. But, hey, it’s just a coincidence that we happened to pick an easy question on a Friday, the day we’re itching to get out of here and go home and spend the weekend watching football a...

Scripting Guy!scripting techniquesVBScript
Dec 8, 2005
Post comments count0
Post likes count0

How Can I Convert Names to Proper Case?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a script that my help desk people use to create user accounts. Unfortunately, sometimes these help desk personnel get in a hurry and type in names like this: kEn MYEr. How can I convert names to proper case (i.e., Ken Myer)?-- LC Hey, LC. You know what: you’re in luck. Usually when it comes to doing anything properly t...

Scripting Guy!scripting techniquesVBScript
Jun 22, 2005
Post comments count0
Post likes count0

How Can I Compare Two String Values Regardless of Letter Case?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I have a script that compares two email addresses and tells me whether or not they are the same. Sometimes the email addresses are the same, but the case is different: for example, one address might be example@abc.com and the other might be example@ABC.com. My script always tells me that these are different email addresses. Ho...

Scripting Guy!scripting techniquesVBScript
Oct 18, 2004
Post comments count0
Post likes count0

How Can I Pick Out and Save Specific Lines in a Text File?

ScriptingGuy1
ScriptingGuy1

Hey, Scripting Guy! I’d like to be able to read through a text file, select the lines that begin with a particular word (like Failure), and then save only those lines back to the same text file. Is there any way to do that?-- AC Hey, AC. Hey, AC. For simplicity’s sake, we’re assuming you have a text file that looks similar to this:Success - Oper...

Scripting Guy!scripting techniquesVBScript
Sep 16, 2004
Post comments count0
Post likes count0

How Do I Get Rid of Extraneous Spaces in a String?

ScriptingGuy1
ScriptingGuy1

I know that I can use the Split command to separate a sentence like this - VBScript is fun! - into an array of individual words. However, what happens if I have a sentence like this: VBScript is fun! I can’t use a blank space as the delimiter because I might have lots of blank spaces. And I can’t use a specific number of blank spaces as the delimi...

Scripting Guy!scripting techniquesVBScript