Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ExtractNumbers(MyString){
- firstdot := 0
- Loop, Parse, MyString
- {
- If A_LoopField is Number
- NewVar .= A_LoopField
- IfInString,A_LoopField,.
- {
- if (firstdot = 0){
- NewVar .= A_LoopField
- firstdot := 1
- }
- }
- IfInString,A_LoopField,`,
- NewVar .= A_LoopField
- IfInString,A_LoopField,-
- NewVar .= A_LoopField
- }
- StringReplace, NewVar, NewVar,`,,, ;;remove dots
- ; Remove Leading dashes dots and commas
- NewVar := RegExReplace(NewVar, "^[\-.,]*")
- ; Trailing
- NewVar := RegExReplace(NewVar, "[\-.,]*$")
- Return NewVar
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement