How to deleting a specific character in first left ?
Ex:
Code: Select all
080 get 80
Or
008 get 8
Or
ABA get BA
But this delete all character :/
Thank for your help
Code: Select all
080 get 80
Or
008 get 8
Or
ABA get BA
Code: Select all
var := "00080"
RegExMatch(var, RegExMatch(var, "^\d*$") ? "([1-9]\d+$)" : "((?<=\w)\w+$)", res)
MsgBox, % res
Thank you working !Capn Odin wrote:Are you saying you want to remove all leading zeros from numbers and only the first char from strings ?
Edit: If so try this.Code: Select all
var := "00080" RegExMatch(var, RegExMatch(var, "^\d*$") ? "([1-9]\d+$)" : "((?<=\w)\w+$)", res) MsgBox, % res
Marvin1023 wrote:Just like that !
it is possible to add a condition ?
Ex:
00000080 get 080
0080 get 080
Code: Select all
var := "00080"
RegExMatch(var, RegExMatch(var, "^\d*$") ? (RegExMatch(var, "^00") ? "(0[1-9]\d+$)" : "([1-9]\d+$)") : "((?<=\w)\w+$)", res)
MsgBox, % res
Users browsing this forum: MSN [Bot], NinjoOnline and 210 guests