HI @ All,
I have a scenario like in excel I have a data
Example - TSPRST12378QR-QT
Here I need to remove from right side first R,with including that R I need to remov
output - TSPRST12378Q
I need output like this,can you suggest me
HI @ All,
I have a scenario like in excel I have a data
Example - TSPRST12378QR-QT
Here I need to remove from right side first R,with including that R I need to remov
output - TSPRST12378Q
I need output like this,can you suggest me
Please find the sample
You can try using REGEX
output_string = System.Text.RegularExpressions.Regex.Match("TSPRST12378QR-QT","(\w+)(?=R.*)").ToString
Hi @ranjith,
Same case we need to check with R & T
if it ends with R rest of we remove & it ends with T rest we need to remove
from right hand side we need to check if it is ending with T & R
In this above image both ends with T & ends with R we have
If from right hand side starting With T then it will remove data from T
If from right hand side starting With R then it will remove data from R
This solves for the first case you asked for
Input.Substring(0,Input.Length-((New String( Input.ToCharArray.Reverse().ToArray)).IndexOf(“R”)+1))
Can you send us a sample showing Input and Output of some of the data to clearly understand.
Please find the image for better understanding of scenario
@varunk Try this
output_string = System.Text.RegularExpressions.Regex.Match("TSPRST12378QR-QT","(\w+)(?=(R|T).*)").ToString
Hi @ranjith
I need to do for another thing in that
from right if first we have R we need to take left three digits from R
from right if first we have T we need to take left three digits from T
Please find the input & output
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.