DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > ASP Development

Discuss "trim" in the ASP Development forum.

ASP Development - Learn coding practices and tips to get the best out of your Active Server Pages (ASP). The Classic ASP forum is for ASP/VBScript and ASP/JScript applications.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old May 8th, 2008, 12:58 PM
Contributing Member

 
Join Date: Mar 2008
Posts: 174
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1
todd2006 is an unknown quantity at this point
Default trim

Hi,

I have a variable called

str=", Hello How are you"

I want to remove the comma at the start of the string

I tried Len and LTrim but it didnt work out

any idea

todd
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old May 8th, 2008, 01:08 PM
jmurrayhead's Avatar
Your Lord & Master

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 534
Thanks: 14
Thanked 39 Times in 38 Posts
Blog Entries: 2
Rep Power: 1
jmurrayhead will become famous soon enough

Awards Showcase
Microsoft SQL Server Microsoft Windows Microsoft .Net Classic ASP 
Total Awards: 4

Default

Code:
Dim str
str = ", Hello how are you"
str = Right(str, Len(str) - 2)
__________________
jmurrayhead
Did I help you out? Make me popular by clicking the icon!

If you found a post helpful, please click the button in the lower right-hand corner of the post.

Powered by ASP.Net
Reply With Quote
  #3 (permalink)  
Old May 8th, 2008, 01:17 PM
mehere's Avatar
Super Mistress of Sarcasm

 
Join Date: Mar 2008
Location: Wide Awake In Dreamland
Posts: 111
Thanks: 8
Thanked 20 Times in 18 Posts
Rep Power: 1
mehere is on a distinguished road

Awards Showcase
Microsoft SQL Server Classic ASP 
Total Awards: 2

Default

will there always be a comma at the beginning of the string? ... if not, try this
Code:
if inStr(str, ",") = 1 then
     str = trim(mid(str,2,len(str)))
end if
__________________
Quote of the Month:
Strife: As long as we have each other, we'll never run out of problems.

Questions to Ponder:
Should vegetarians eat animal crackers?

iif([sarcasm]=true,iif([you have to ask]=true,"didn't work","ha ha ha"),"not sarcasm")
copyright © 2008 sbenj69

Last edited by mehere; May 8th, 2008 at 01:31 PM.
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > ASP Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 10:59 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46