Hi
Input: GEMSAM_OU_CLP_GEMS_CHL
How to get the output mentioned below from the above string
output:
CHL
Thanks
Likitha
Hi
Input: GEMSAM_OU_CLP_GEMS_CHL
How to get the output mentioned below from the above string
output:
CHL
Thanks
Likitha
StrText=âGEMSAM_OU_CLP_GEMS_CHLâ
You can trh this ⌠It will give you CHL
StrText.Split("_"c).Last
for reference you can see the output: -
you can try this regex expression also
strText = âGEMSAM_OU_CLP_GEMS_CHLâ
System.Text.RegularExpressions.Regex.Split(strText,â_â).Last
output
let me its working or not for you
@vinjam_likitha
You can use string split functionsâŚ
yourinput.Split("_"c).Last
Try this-
Assign:
- InputString = âGEMSAM_OU_CLP_GEMS_CHLâ
- OutputString = InputString.Split("_"c).Last()
Thanks!!
Hi,
you can use below expression:
System.Text.RegularExpressions.Regex.Match(Input, â([^_]+)$â).Value
Explanation:
"([^_]+)$"
is used to match the last sequence of characters that doesnât contain underscores in the input string.Match(Input, "([^_]+)$")
finds the last match in the input string, and Value
extracts that match.1st Assign variable
StrText= âGEMSAM_OU_CLP_GEMS_CHLâ
2nd use substring
StrText.Substring(StrText.LastIndexOf(â_â)+1)
Note I am useing c# langauage
You can use the Data manipulation and Regular expression for this.
Data Manipulation -
- Assign -> Input = "GEMSAM_OU_CLP_GEMS_CHL"
- Assign -> Output = Input.Split("_").Last
Regular expressions -
- Assign -> "GEMSAM_OU_CLP_GEMS_CHL"
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(yourstringinput.ToString,â((?<=\_)[A-Z]+$)â).Value
Hope it helps!!