Jump to content
Sign in to follow this  
Agent Orange

Trim empty spaces

Recommended Posts

Agent Orange

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

Share this post


Link to post
Share on other sites
Jos

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Agent Orange

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

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
Agent Orange

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.

Share this post


Link to post
Share on other sites
SmOke_N

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.

Share this post


Link to post
Share on other sites
Agent Orange

Sorry all....I'm a noob. I'll research this better before bothering you again.

Edited by Agent Orange

Share this post


Link to post
Share on other sites
Jos

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

:)


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.