Suppose I have a text value like → axftrbc.10111.111.0101
I want the output to be only → axftrbc
I also want to check if the original text contains a .(dot) or something like the format or anything to ensure when i split it do not break, then i want to split it and get this first server value → axftrbc.
Will this also work if the text axftrbc.10111.111.0101 changes to this → axftrbc.10111.111.0101.111.1234.12345 meaning increasing in values post .(dot)?
In my use case I want to use it in a invoke code activity, something like below(example)
dt.AsEnumerable.ToList.ForEach(Sub(row)
If row("Host name").ToString.equals("abcdef.1101101.191.10") Then
row("Host name")=row("Host name").Replace("abcdef.1101101.191.10","abcdef")
End If
End Sub
)
Here If Host name column contains the above regex matching value ->abcfdr.11011.1101.11 this one then i want to replace it with that first value → abcfdr
I tried your code by incorporating in invoke code but it is giving compilation error.
Can you please help here.
I’m not sure it’s fit your requirement, but can you try to use the following condition in If statement in line 2? Probably warning will be disappeared.