• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 59
  • Last Modified:

trim not trimming in vb.net

I have this loop which creates the string but leaves a space at the end.
The Chr(32) is putting the space in between the words.
How can I get it not to leave a space at the end.

  For Each drRecordW As DataRow In dtCodeWords.Rows
                    StrShortString = StrShortString & drRecordW("word") & Chr(32)
                    RTrim(StrShortString)
                    Debug.Print(StrShortString)
                Next

Open in new window

0
PeterBaileyUk
Asked:
PeterBaileyUk
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
you need to store the result back into the variable:
StrShortString = RTrim(StrShortString)

Open in new window

0
 
PeterBaileyUkAuthor Commented:
thank you!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now