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

PeterBaileyUkAsked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.