Hello, I am trying to use Regex.Replace to cut the substring ‘TO’ from a sentence.
However, I am encountering an error in the ASSIGN activity, while the LOGMESSAGE activity is not showing any errors.
I would appreciate any advice on the difference between the two.
Thank you in advance for your response!
Hi,
Can you share whole the expression?
Regards,
Can you try the below syntax:
System.Text.RegularExpressions.Regex.Replace(Input,"TO","")
Can you share the expression that you have written?
Regards
@Yoichi
Thank you for the response!
This is the code
System.Text.RegularExpressions.Regex.Replace(item,“TO”,“”)
Thank you for the response!
This is the code
System.Text.RegularExpressions.Regex.Replace(item,“TO”,“”)
Still, an error occurs
Hi,
It may be validator problem. Can you try to clear right side expression and unfocus, then re-input it?
System.Text.RegularExpressions.Regex.Replace(item,"TO","")
Regards,
Can you try the below syntax:
System.Text.RegularExpressions.Regex.Replace(item.ToString,"TO","")
or you can use the below syntax:
item=item.ToString.Replace("TO","")
Hope it helps!!
Create a variable Str_Input
Str_Input=item.ToString.Replace("To","")
Hope this helps you
@Yoichi
Thank you for the response! However, errors continue to occur.
Is there an issue with the Argument type, as shown in the screenshot?
@Parvathy
Thank you for the response! However, errors continue to occur.
Is there an issue with the Argument type, as shown in the screenshot?
Hi,
Can you try to change Object to String in ArgumentType?
Regards,
Thank you for the response! However, errors continue to occur.
Is there an issue with the Argument type, as shown in the screenshot?
Please change the argument type to string
@Yoichi
Thank you for the response.
I succeeded in deleting, but when trying to delete the part @" TO : ',
I am unable to remove the @" Could you please provide a solution?"
@Parvathy
Thank you for the response.
I succeeded in deleting, but when trying to delete the part @" TO : ',
I am unable to remove the @" Could you please provide a solution?"
@rlgandu
Thank you for the response.
I succeeded in deleting, but when trying to delete the part @" TO : ',
I am unable to remove the @" Could you please provide a solution?"
InputString.Replace(“@”,“”).Replace(“To:”,“”)
Hi,
Did you check it at locals panel? As it’s C# syntax , we can ignore it. (It’s not content of the variable)
Can you also check it using MessageBox etc?
The following may also help you.
Regards,
@rlgandu
Thank you for the response!!!
Have a great day today!