Last three characters remove string

Hello,

I would like to split a string so that I remove the last three characters from it
E.g.
Input(1)

to

Input

Any help would be appreciated,
Thanks

For reference, I got a correct answer for removing the first three characters here:
StringVar="(1)Input" StringVar= StringVar.substring(3,StringVar.length-3)

I’m just struggling to translate it to last three characters

@mzucker
use substring as below to get required characters-
string.substring(indexNo,total characters you want from that index)

Thanks!
Navneet

2 Likes

@mzucker

Try this:

varStr = “Input(1)”

varStr.Split("(".TocharArray)(0)
Or
varStr.Substring(0,varStr.Length-3)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.