[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
MicroSurvey Software Inc. • View topic - how to trim spaces in a string

how to trim spaces in a string

Discussion of MicroSurvey CAD related issues and questions.

Moderators: Brian Sloman, Jason Poitras, James Johnston

how to trim spaces in a string

Postby glendon » Thu Jan 28, 2010 1:04 pm

I tried to erase spaces in a string using LISP; the help system gives explanation as follows.
But 'trim' is always used for lines. I coded some lisp for MSCAD 2010, they all work well.

thanks


(trim string [flag])
--------------------------------------------------------------------------------
Erase blank spaces in a string.
--------------------------------------------------------------------------------

This function trims spaces from the specified string.

The optional flag argument represents the options for stripping spaces:


Flag Meaning
none Strip all spaces from beginning and end.
"B" Strip spaces from beginning of string.
"M" Strip spaces from middle of string.
"E" Strip spaces from end of string.
"BE" Strip spaces from beginning and end of string.
"ME" Strip spaces from middle and end of string.
"BM" Strip spaces from beginning and middle of string.
glendon
 
Posts: 9
Joined: Wed Jan 27, 2010 10:55 am

Re: how to trim spaces in a string

Postby Brian Sloman » Thu Jan 28, 2010 7:33 pm

Brian Sloman
Development Manager
MicroSurvey Software Inc.
User avatar
Brian Sloman
Product Manager
 
Posts: 403
Joined: Fri Jan 07, 2005 4:42 pm
Location: Westbank, BC, Canada

Re: how to trim spaces in a string

Postby glendon » Fri Jan 29, 2010 7:18 am

Thank you, Brian
Your codes work, I was wrong in selecting text.
glendon
 
Posts: 9
Joined: Wed Jan 27, 2010 10:55 am


Return to MicroSurvey CAD

Who is online

Users browsing this forum: No registered users and 5 guests

cron