String manipulation in data

I need to extract number 30 from below data.
Note that the data is dynamic. the data keeps on changing.

00:00:30.4451618

Also how to extract only 00:00:30 number and exclude numbers after dot

Hello @basavarajbennur07

You can use Regex to get the number.

Assign str_result = System.Text.RegularExpressions.Regex.Match(str_input,":(?'Number'\d+)\.").Groups("Number").ToString

Download file here:
Regex.xaml (8.5 KB)

Regards
Soren

Also how to extract only 00:00:30 number and exclude numbers after dot

string looks like hours, minutes, seconds, milisesconds

also have a look here:

1 Like

grafik

Hi @basavarajbennur07

Try this string manipulation

Output

Peter’s posts are definently the “most correct” way of achieving what you are looking for.

str_data=“00:00:30.4451618”
please use below syntax to get required output:
str_data.Split(".“c)(0).Split(”:"c).Last()