How to Remove Special Characters starting with

Hi,

i have one issue…

Can you tell how to remove the special characters starting with the text.

Sample Words

(25
{[Zinc
#2542
${(Ports

Expected output

25
Zinc
2542
Ports

i am try to type the text or words i got error on special character so that i want to remove if starting with special character remove all the special character from the text.

Thanks
Shyam

Hi @Shyam_Pragash

How about this expression

System.Text.RegularExpressions.Regex.Replace(YourString, “[^a-z A-Z 0-9]”,“”)

Regards
Gokul

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Replace(yourString,"^[\W_]+","")

Regards,

1 Like

hi
Can i try this code…

Thanks
Shyam

Hi
Can i try this code…

Thanks
Shyam

What are you trying @Shyam_Pragash

Have you tried about expression?

Regards
Gokul

1 Like

Hi @Gokul001

like this words i am going to type it.

(acrylc acid)
{([2,2′,2]′′)-Nitrilotri(ethan-1-ol)}
β-Aminoethanol
α-Sulfo-ω-(dodecyloxy)
(5R)-[(1S)-1,2-Dihydroxyethyl]

Thanks
Shyam

Can you share the Output @Shyam_Pragash

Hi @Gokul001

Is it possible to type with special character is starting with text using Type into activity ?
or
any other activity ?

i want to type below text :

(acrylc acid)
{([2,2′,2]′′)-Nitrilotri(ethan-1-ol)}
β-Aminoethanol
α-Sulfo-ω-(dodecyloxy)
(5R)-[(1S)-1,2-Dihydroxyethyl]

Thanks
Shyam

This is an new requirement @Shyam_Pragash

Hi @Gokul001

No…, its same process.

i tried to type above text using type into activity… i got error “Special Character Syntax Error”, So that i post is it way to remove special character in starting position.

Thanks
Shyam

Hi,

Can you try the following string as input?

(acrylc acid)
{([[2,2′,2]′′)-Nitrilotri(ethan-1-ol)}
β-Aminoethanol
α-Sulfo-ω-(dodecyloxy)
(5R)-[[(1S)-1,2-Dihydroxyethyl]

Regards,

Hi @Yoichi

i tried i got error

Thanks
Shyam

Hi,

Can you share content of CurrentRow(“Synonyms”).ToString

Or

Try either of measures in the following post.

Regards,

Hi @Yoichi

Input Data

image

Hi,

Please check my previous post in detail. I doubled [ character , as the following.

(acrylc acid)
{([[2,2′,2]′′)-Nitrilotri(ethan-1-ol)}
β-Aminoethanol
α-Sulfo-ω-(dodecyloxy)
(5R)-[[(1S)-1,2-Dihydroxyethyl]

Or can you try the following expression?

System.Text.RegularExpressions.Regex.Replace(CurrentRow("Synonyms").ToString,"\[(.*?])","[[$1") 

Regards,

1 Like

Hi @Yoichi @Gokul001

Thanks You

Code is working : System.Text.RegularExpressions.Regex.Replace(CurrentRow(“Synonyms-SD”).ToString,“[(.*?])”,“[[$1”)

Thanks
Shyam

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.