Remove Text From string1

Hey i have a string in datatable
000050996-001/1
I want to remove 001/ and want output as 000050996-1

Hi @Kuldeep_Pandey

Try this:

Assign activity:
Dim inputString As String = "000050996-001/1"
Dim outputString As String = System.Text.RegularExpressions.Regex.Replace(inputString, "[\d]+\/", "")

Log Message activity:
Output: "Output string: " + outputString

Hope it helps!!

Hi @Parvathy ,
you can use regex,
or get string remove substring if all item same format
regards,
LNV

Thanks , We can also do this from replace string

@Kuldeep_Pandey

I have used replace function only with regex expressions.

Regards,

1 Like

Hi @Kuldeep_Pandey

row(“Column1”) = row(“Column1”).ToString.Replace(“001/”, “”)

1 Like

If all row same format you can use
row(“ColumnName”) = row(“ColumnName”).ToString.Replace(“001/”, “”)

1 Like

string.replace(“001/”,“”)

1 Like

you can try with regex also ! @Kuldeep_Pandey

image

Hi @Kuldeep_Pandey

  1. Drag and drop a For Each Row activity onto your workflow.
  2. Configure the For Each Row activity to iterate through your DataTable (myDataTable).
  3. Inside the For Each Row activity, add an Assign activity.
  4. In the Assign activity, set the left-hand side to row("ColumnName").
  5. Set the right-hand side to row("ColumnName").ToString.Replace("001/", "").

row("ColumnName") = row("ColumnName").ToString.Replace("001/", "")


Hope it helps!!

1 Like

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