TrimEnd not working?

bjwade62

Well-known member
Joined
May 25, 2006
Messages
50
Programming Experience
3-5
Here's what I have. The selected text in a FileListBox is Detail.wmf. I'm trying to get strTrimmed to equal Detail without the .wmf. What am I doing wrong?

Dim strTrimmed As String = Me.FileListBox.Text.TrimEnd("wmf")


thanks,
Bernie
 
try this:

Dim strTrimmed As String = Me.FileListBox.Text.Replace(".wmf","")


I guess the reason trimEnd does not work is that it expects to be passed a charArray not a string

You could try:
Dim strTrimmed As String = Me.FileListBox.Text.TrimEnd(CChar(".wmf"))
 
Last edited:
Back
Top