How to delete string at 1st place in excel

Can you try this:
System.Text.RegularExpressions.Regex.Replace(row(“Address”).ToString.ToUpper,”[2]+“,”").ToString.Trim


  1. THOR ↩︎

  2. THOR ↩︎

1 Like

Thanks @Saranyajk for your efforts,
Input


Output I need :

I want “THOR” and “thor” to be deleted only at the first place, But with your workflow “THOR” and “thor” are deleting everywhere

ok, you can split to string, check if first place is Thor, then delete

1 Like

what about at the end, you want thor or not?

1 Like

Yes I want it at the end or anywhere else , I want it to be deleted only if it is at starting

Thanks @suraj3501, I tried it…but not getting expected output

try this inside for each row


input is same as before
output image

1 Like

@Saranyajk Thanks for the work you have done for me…I tried your process…I am not getting the expected output

1 Like

can you show your work please

1 Like

Yeah, Once check this workflow
Process4.zip (2.3 KB)

1 Like

Main_Forum.xaml (99.4 KB)

IF condition is true, you have to use the replace activity, thats why

1 Like

@Saranyajk Now I changed this as you said and I also saw your workflow,but still facing same problem.Once see this and tell me if any changes are there in this workflow
Process4.zip (2.4 KB)

1 Like

yes ofcourse, you need to write the new address in your datatable, and then write the datatable otherwise the values in datatable, dont change. for that assign row("address)=new_Address

@Saranyajk You mean I need to add New Address Column in the excel? or I need to add WriteLine activity and specify the new address datatable

1 Like

image

you need to add this assign, otherwise Datatable will not be updated

1 Like

first modify the database value and then write to EXCEL

1 Like

@Saranyajk Thank you…Now the first string got deleted everywhere but I kept “THOR” in middle…that one also got deleted
Input


Output I got

In 5th and 6th rows I kept “THOR” in middle of text…That one got deleted but as per the code that should not delete because we mentioned that only first place must delete if it contains “THOR”/“thor”

@Saranyajk Can you please check if anything is wrong
Process4.zip (2.5 KB)