Can you show the result of the different options?
I mean you could also use substring, but the other options (trimstart / replace ) also work.
Can you start with putting the original value between quotes? " 004560" , Like Yoichi said there might be whitespaces there at the beginning.
If al else fails you can invoke code, and then split the original value in chars and decide what you want to keep. Would be a bit of a workaround as I don’t see why the other options should not work.
For Each c As Char In Input
If c.ToString.IsNumeric And newval.Length=0 Then
If c.ToString=“0” Then
Console.WriteLine(“Loosing another 0”)
Else
newval= c.ToString
End If
Else If c.ToString.IsNumeric And newval.Length>0 Then
newval=newval+ c.ToString
Else
Console.WriteLine("What else is in this string? "+c.ToString)
End If
Next
i have a number 123456 and I want to add “-” inbetween after 4 number from right side.
Length of number is either 10 or 12 but I want “-” after 4 number from right side…