Get the first value of the string

N0011 526.17 mm

this is string i want only N0011

1 Like

Hi this expression would help you in that
If str_input = “N0011 526.17 mm“
Then
str_output = Split(str_input,” “)(0).ToString.Trim

Cheers @ashishmani

1 Like

N0011…526.17…mm

@Palaniyappan here “…” means space.
so their is space between n0011 and 526.11

Yes exactly buddy
This would expression has the same

Kindly try this and let know for any queries or clarification
Cheers @ashishmani

1 Like

@Palaniyappan not working

Hmmm…That would work for sure buddy
Can I have a view in the expression you have used in your activity with a screenshot if possible
Cheers @ashishmani

image
image

1 Like

Hi @ashishmani

Try this

str = “N0011 526.17 mm”

str.Split(" "c)(0).ToString.Trim

image

Regards,
Kommi Jeevan.

1 Like

Use below code,
Var(String) = System.Text.RegularExpressions.Regex.Split(Str," ")(0)

Hmmm
It looks like a tab
Fine
Try with this expression
str_output = str_input.Substring(0,5).ToString
If that N0011 length is same and value differs

Cheers @ashishmani

@Palaniyappan thanku for ur support, i get the solution, by using reqex.

1 Like

Hi @ashishmani

if this is your input string (N0011…526.17…mm)

then try this

  `inputString.Split({"…"}, StringSplitOptions.None)(0).Trim`

@anoopap … means their is space