Remove Furthest Right Character In String

  • Thread starter Thread starter frank
  • Start date Start date
Hi:

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

Hope this help,
 
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

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

Thanks,
 
Back
Top