Jump to content

Trim empty spaces


Recommended Posts

What is command that can be used in AutoIt that will do a trim of empty spaces from text that you've grabbed into a variable. Example:

I have a script that grabs the author name from a Word document and inputs it into the Author section of the Properties window. When it adds it to the box there are a bunch of preceeding spaces in front of that name.

How can I clean up those spaces before it gets added.

I know VB has trim or rtrim ltrim.

thanks

Link to comment
Share on other sites

  • Developers

What is command that can be used in AutoIt that will do a trim of empty spaces from text that you've grabbed into a variable. Example:

I have a script that grabs the author name from a Word document and inputs it into the Author section of the Properties window. When it adds it to the box there are a bunch of preceeding spaces in front of that name.

How can I clean up those spaces before it gets added.

I know VB has trim or rtrim ltrim.

thanks

Did you open the Helpfile a search ?

I am sure its there... :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

What is command that can be used in AutoIt that will do a trim of empty spaces from text that you've grabbed into a variable. Example:

I have a script that grabs the author name from a Word document and inputs it into the Author section of the Properties window. When it adds it to the box there are a bunch of preceeding spaces in front of that name.

How can I clean up those spaces before it gets added.

I know VB has trim or rtrim ltrim.

thanks

Ya, I did check the help file first. I don't see a command "trim". I wondering what the equiv would be to that.

thanks

Link to comment
Share on other sites

  • Moderators

Ya, I did check the help file first. I don't see a command "trim". I wondering what the equiv would be to that.

thanks

Since your dealing with "Strings" look at the String* functions in the help file.. as Jdeb said, you'll find all you need there.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

Ok, I what to trim off the leading spaces to the left of the string in question. But I won't know the number of leading spaces.....I just what to trim off all the leading spaces.

How do you do it in VB?

I use StringStripWS() personally.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Developers

Ya, I did check the help file first. I don't see a command "trim". I wondering what the equiv would be to that.

thanks

No, I meant SEARCH not "look in the index"....

Click on the Search tab at the top and type Trim.... I am pretty sure it will show you the correct functions.....

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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