Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > String Concatenation & Removing Space

Reply
Thread Tools

String Concatenation & Removing Space

 
 
Sparky Arbuckle
Guest
Posts: n/a
 
      09-01-2005
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 ""?

 
Reply With Quote
 
 
 
 
Ben
Guest
Posts: n/a
 
      09-01-2005
Try using Trim, Replace would work as well... strRevision.Trim

HTH,
Ben

"Sparky Arbuckle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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 ""?
>



 
Reply With Quote
 
 
 
 
Clamps
Guest
Posts: n/a
 
      09-01-2005
ds.Tables("DataTable").Rows(i)("RevisionString")+= rtrim(ds.tables("DataTable
").rows(i)("RevisionString") & a & ","




"Sparky Arbuckle" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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 ""?
>



 
Reply With Quote
 
Sparky Arbuckle
Guest
Posts: n/a
 
      09-01-2005
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?

 
Reply With Quote
 
Ben
Guest
Posts: n/a
 
      09-01-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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?
>



 
Reply With Quote
 
Sparky Arbuckle
Guest
Posts: n/a
 
      09-01-2005
Thanks Ben

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Python style guide (PEP-8) says 4 space indents instead of 8 space??? 8 space indents ever ok?? Christian Seberino Python 21 10-27-2003 04:20 PM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-24-2003 11:15 AM
Re: Why Python style guide (PEP-8) says 4 space indents instead of8 space??? 8 space indents ever ok?? Ian Bicking Python 2 10-23-2003 07:07 AM
what's the difference between VHDL 93 CONCATENATION and VHDL 87 CONCATENATION? walala VHDL 3 09-18-2003 04:17 AM
Stack space, global space, heap space Shuo Xiang C Programming 10 07-11-2003 07:30 PM



Advertisments