Remove Furthest Right Character In String

I

Ignacio Machin

Hi:

// **** not tested code
stringvar.Remove( stringvar.Length -1 , 1 );

Hope this help,
 
I

Ignacio Machin

Hi Jon,

Jon Skeet said:
Evidently :)

I'm pretty confident that the code will run fine :)
Strings are immutable, so you need something like:

stringvar = stringvar.Remove (stringvar.Length-1, 1);

Well, you will need that if you intend to assign it to the same variable,
but otherwise you would do something like other_string_var =
stringvar.Remove (stringvar.Length-1, 1);

So it's all a question of what you want to do with the string :)

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

 
I

Ignacio Machin

But I agree with you on something, I should have make clear the whole
assignation sentence :)

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top