How to delete string at 1st place in excel

Process3.zip (2.2 KB)


I deleted the string which is present in the first place i.e “THOR " in “Address” Column using Regular Expression and I got the Result like this :

I used this expression in assign activity
System.Text.RegularExpressions.Regex.Replace(row(“Address”).ToString,”^[THOR]+","").ToString.Trim
If I insert this “^” into the expression “THOR” is getting deleted, Its fine But I created another excel sheet…There I gave “thor” at start in some cells and “THOR” at start in some cells…I want a single statement to delete both “thor” and “THOR” at starting.I know that removing “^” will delete the lower case but I want to delete both lower and upper ones with single Statement…It will be really appreciable if anyone suggests me some idea.

hi,
can you try the below expression and check if it works.

Thanks…

1 Like

@shaikmdrafi Thanks for the reply…I checked it.
I gave this one as input


I got the Result like this

But I want Output in this manner

I want “thor” and “THOR” to be deleted at beginning using the single statement…Can you please tell me any idea for that

Can anyone please suggest me some idea

read the excel and get it datatable
For each row in that datatable
get the row(“Address”) in a string ex Add_String
Assign Add_String=Add_String.replace(“Thor”,"")
like this you can specify for THOR,thor etc.
Hope this solves your issue. Plaese try and let me know if it works.

1 Like

Hi @Saranyajk, Thanks for the reply, I want to delete both “thor” and “THOR” using one single statement in assign activity…How to do?

1 Like

try this

Try this expression
@Kavyasri
System.Text.RegularExpressions.Regex.Replace(row(“Address”).ToString,”^[thor|THOR]+","").ToString.Trim

3 Likes

Thanks for the help…I tried this but I am not getting the expected output

@hasib08 Thanks for the suggestion, I tried this expression now…I am not getting the expected output…I need “thor” and “THOR” to be deleted at the beginning but when I use this expression only “THOR” is getting deleted at the beginning…

Try this expression
@Kavyasri

This perfectly works for me, if you still havent sorted, try this

1 Like

Thank you @hasib08 , I tried…still facing the same problem

image

my sample output

1 Like

Thank you @Saranyajk, can you please share me your input

image

1 Like

@Saranyajk,if you dont mind…can you please add “THOR” before agsahGSDH and try your workflow,and show me the Result you got.
Thanks &Regards

1 Like

Input image
Output Log image

1 Like

Please Mark it as solution, If it works for you, thanks, Happy Automation

1 Like