Need regex or string manipulations or logic

hi team,

i have a address like

3508 S LaFountain St Kokomo, IN 46902

above string is the address … so every time the address will change based on the user…

so i need a output like - 3508 S LaFountain St

which is before comma(“,”) i need to avoid …

can i get the solution please

1 Like

Hi @katta_nikhil

(.*)(?=\,)

Or

(.*)(?=\s+.*\,)

System.Text.RegularExpressions.Regex.Match(Input,"(.*)(?=\s+.*\,)").ToString

Regards,

@katta_nikhil

Another approach

Finaladdress= address.Split(","c)(0).Trim()

Regards,

@katta_nikhil
image

\d+.*(?=\,)
Str_Output=System.Text.RegularExpressions.Regex.Match(Input,"\d+.*(?=\,)").ToString

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