I have a string variables which consists of 22 or 23 alpha numeric characters. I want to shortern this to 16 characters. Need to remove the characters within the forward slashes also need to remove the slashes too. How to do this ??
Attached some examples
Variable 1: ABCD123456/AB/C/123456
Variable 3: ZXYZ987653/MK/YD/098123
Variable 4: QWER456789/VS/P/[889933
Hello @Praveen_Vs , Try Regex replace method
System.Text.RegularExpression.regex.Replace(Yourstring,"\/.*\/.*\/\W|\/.*\/.*\/","").ToString.Trim

Hey @Praveen_Vs
Use the below method
startIndex = str.IndexOf("/")
EndIndex = str.LastIndexOf("/")
str = str.Substring(0, startIndex)+str.Substring(EndIndex+1)
Thanks,
Sanjit

