thank you BoBo
I'm interesting for 3th example : shoul'd remove leading zero's but not the last zero's
Code: Select all
;---------------------------------------------------------
;- example-1 : remove first character
k = 0123456089010
stringtrimleft,knew,k,1
msgbox, 262208,1st-Example ,%knew%
;---------------------------------------------------------
;- example-2 : doesn't remove leading zeros more then one
x:="0123456089010"
y:="001234560890100"
z:="00012345608901000"
x1:= InStr(SubStr(x,1,1),0) ? StrReplace(x,0,"",,1) : x
y1:= InStr(SubStr(y,1,1),0) ? StrReplace(y,0,"",,1) : y
z1:= InStr(SubStr(z,1,1),0) ? StrReplace(z,0,"",,1) : z
msgbox, 262208,2nd-Example ,x1=%x1%`ny1=%y1%`nz1=%z1%
;--------------------------------------------------------
;-- example-3 : remove leading zeros , but remove also last zero's
x2:=StrTrim(x, "0_\0")
y2:=StrTrim(y, "0_\0")
z2:=StrTrim(z, "0_\0")
msgbox, 262208,3th-Example ,x2=%x2%`ny2=%y2%`nz2=%z2%
StrTrim(String, TrimChars)
{
if !(DllCall("shlwapi.dll\StrTrim", "Ptr", &String, "Ptr", &TrimChars))
return FALSE
return StrGet(&String)
}
;========================================================