Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - String Concatenation & Removing Space

 
Thread Tools Search this Thread
Old 09-01-2005, 10:09 PM   #1
Default String Concatenation & Removing Space


I am able to build a string for a product revision and was curious
about removing the space. The only way that I have successfully built
the string was to use:

a = integer
strRevision = string

ds.Tables("DataTable").Rows(i)("RevisionString") += strRevision & a &
","

so if product A had 4 revisions, it would look like:
A 1,A 2,A 3,A 4,

I would like this to look like:

A1,A2,A3,A4,etc...

How would I go about doing this? Would I have to create a function that
will Replace the space with ""?



Sparky Arbuckle
  Reply With Quote
Old 09-01-2005, 10:16 PM   #2
Ben
 
Posts: n/a
Default Re: String Concatenation & Removing Space
Try using Trim, Replace would work as well... strRevision.Trim

HTH,
Ben

"Sparky Arbuckle" <> wrote in message
news: oups.com...
>I am able to build a string for a product revision and was curious
> about removing the space. The only way that I have successfully built
> the string was to use:
>
> a = integer
> strRevision = string
>
> ds.Tables("DataTable").Rows(i)("RevisionString") += strRevision & a &
> ","
>
> so if product A had 4 revisions, it would look like:
> A 1,A 2,A 3,A 4,
>
> I would like this to look like:
>
> A1,A2,A3,A4,etc...
>
> How would I go about doing this? Would I have to create a function that
> will Replace the space with ""?
>





Ben
  Reply With Quote
Old 09-01-2005, 10:18 PM   #3
Clamps
 
Posts: n/a
Default Re: String Concatenation & Removing Space
ds.Tables("DataTable").Rows(i)("RevisionString")+= rtrim(ds.tables("DataTable
").rows(i)("RevisionString") & a & ","




"Sparky Arbuckle" <> wrote in message
news: oups.com...
> I am able to build a string for a product revision and was curious
> about removing the space. The only way that I have successfully built
> the string was to use:
>
> a = integer
> strRevision = string
>
> ds.Tables("DataTable").Rows(i)("RevisionString") += strRevision & a &
> ","
>
> so if product A had 4 revisions, it would look like:
> A 1,A 2,A 3,A 4,
>
> I would like this to look like:
>
> A1,A2,A3,A4,etc...
>
> How would I go about doing this? Would I have to create a function that
> will Replace the space with ""?
>





Clamps
  Reply With Quote
Old 09-01-2005, 10:31 PM   #4
Sparky Arbuckle
 
Posts: n/a
Default Re: String Concatenation & Removing Space
Thanks for the trim suggestions. I copied & pasted Clamps' code sample
and the end result wasn't what I expected.

Before: A 1,A 2,A 3,A 4,A 5,
After: 1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,1,1,2,1,1,2,3,1,1,2, 1,1,2,3,4,5,

Am I doing something wrong here?



Sparky Arbuckle
  Reply With Quote
Old 09-01-2005, 11:24 PM   #5
Ben
 
Posts: n/a
Default Re: String Concatenation & Removing Space
Based on your original post I would try somthing like...

ds.Tables("DataTable").Rows(i)("RevisionString") += RTrim(strRevision) & a &
","

I don't know vb.net soo that code is a guess.

Personally I'd do a standard trim, because your rtrim will only trimming
trailing spaces.

"Sparky Arbuckle" <> wrote in message
news: oups.com...
> Thanks for the trim suggestions. I copied & pasted Clamps' code sample
> and the end result wasn't what I expected.
>
> Before: A 1,A 2,A 3,A 4,A 5,
> After: 1,1,2,1,1,2,3,1,1,2,1,1,2,3,4,1,1,2,1,1,2,3,1,1,2, 1,1,2,3,4,5,
>
> Am I doing something wrong here?
>





Ben
  Reply With Quote
Old 09-01-2005, 11:47 PM   #6
Sparky Arbuckle
 
Posts: n/a
Default Re: String Concatenation & Removing Space
Thanks Ben



Sparky Arbuckle
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Give you enough string functions in Java web reporting tool freezea Software 0 10-08-2009 09:03 AM
Java String Problems rbnbenjamin General Help Related Topics 0 02-03-2009 11:02 PM
ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) msandlana Software 0 04-25-2008 06:37 AM
Hidden linebreaks in string? VB.NET Jiggy Software 0 04-23-2008 02:18 PM
How to free disk space? ncdatta General Help Related Topics 0 10-22-2006 07:56 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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