Remove last 3 characters from the string

Hi,

I want to remove the last three characters (123) from this string (company name 123) such that my message box will only appear the company name. How do I go about doing this?

Cheers

HI @lq_c

You can try with Regex Expression

System.Text.RegularExpressions.Regex.Replace(YourString,"\d*$","").Tostring.Trim

image

image

Regards
Gokul

Hi,

FYI, another solution:

If your number is always 3 digit at the end of the string, the following will work.

image

Left(yourString,yourString.Length-3).Trim

Regards,

1 Like

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