String Concatenation & Removing Space

  • Thread starter Sparky Arbuckle
  • Start date
S

Sparky Arbuckle

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 ""?
 
C

Clamps

ds.Tables("DataTable").Rows(i)("RevisionString")+=rtrim(ds.tables("DataTable
").rows(i)("RevisionString") & a & ","
 
S

Sparky Arbuckle

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?
 
B

Ben

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top