If the numeric part would always be followed by an
e
, then you could use
String.Split[
^] to split the string into an array and then take the first part of the array:
Dim input As String = "1.9e-3mA"
Dim result As String = input.Split("e"c)(0)
But you said in your comment that it won't always be an
e
, so you can use
Regex.Split[
^] to split by a regular expression:
Dim input As String = "1.9e-3mA"
Dim result As String = Regex.Split(input, "[^.\d-]")(0)
This will split the input string at the chars that are not a digit or a dot, and then it takes the first part of the array to get the numeric part.