Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 14989

I need help with an error I keep getting

$
0
0
Hi so I am creating this program and I have a checkbox with a text box
I am using
Code:

textbox.Text = textbox.Text.Remove(textbox.Text.LastIndexOf(","c), 1)
to remove a , at the very end of a list in the textbox. When I check the box it works, and deletes the , at the end, but when I uncheck the box I get the following error "System.ArgumentOutOfRangeException: 'StartIndex cannot be less than zero.
Parameter name: startIndex'"
what can I do to get around this?

Viewing all articles
Browse latest Browse all 14989

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>