![]() |
|
|
|||||||
![]() |
ASP Net - String Concatenation & Removing Space |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|
|
|
#6 |
|
Posts: n/a
|
Thanks Ben
Sparky Arbuckle |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |