Removing some character

Hi,

123/456/789/R1
124/789/789

in this some cases have /R1 some cases dont have that element now i need one regex condition if its found /R0 or /R1 or /R2 whatever revision it may be u can remove it and keep only without revision value its remove /R to ehat ever number next to that from /R itself ignore those characters

Thanks in advance

Hi
–use this expression in a assign activity
str_output = IF(str_input.Contains(β€œR”),Split(str_input,β€œ/R”)(0).ToString,str_input)

where str_input = β€œ123/456/789/R1” and str_output is a variable of type string
Cheers @Shriharsha_H_N


it is the error

just now i modified the expression buddy
str_output = IF(str_input.Contains(β€œR”),Split(str_input,β€œ/R”)(0).ToString,str_input)

Cheers @Shriharsha_H_N

Hi,

You can get it using Replace activity the following settings.

Pattern β€œ/RΒ₯d+$”
Replacement β€œβ€

Regards,

hi @Shriharsha_H_N

first match string with following RegEx

regEX : . β€œ[0-9/]+/R.”

if it matched then you remove the /R char from it.
if not matched then do nothing

Regards
Ajay