This seems very simple. I must be overlooking something easy. I am trying to remove a character from a string and I am failing miserably.
The status.Remove line is not removing anything at all. Am I using the wrong stuff? What I want my status string to read is:
"status in ('status1','status2','status3')"
Thanks for the newbie help
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] status [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = "status in ('status1','status2','status3',)"[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] L [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
[SIZE=2]L = status.Length[/SIZE]
[SIZE=2]L = L - 2[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] status.Substring(L) = ",)" [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'this reads from the comma forward[/COLOR][/SIZE]
[SIZE=2]status.Remove(L, 1) [/SIZE][SIZE=2][COLOR=#008000]'this deletes the commma (**i thought)[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2]MsgBox(status)[/SIZE]
The status.Remove line is not removing anything at all. Am I using the wrong stuff? What I want my status string to read is:
"status in ('status1','status2','status3')"
Thanks for the newbie help