1. code
Code: Select all
Call2 := RegExReplace(Call, "\s" "")
RegExMatch(call2, "(.*)Radio](.*):", name)
Code: Select all
Call5 := RegExReplace(Call, "-" "")
RegExMatch(call2, "(.*)Radio](.*):", name)
Code: Select all
Call2 := RegExReplace(Call, "\s" "")
RegExMatch(call2, "(.*)Radio](.*):", name)
Code: Select all
Call5 := RegExReplace(Call, "-" "")
RegExMatch(call2, "(.*)Radio](.*):", name)
my script has to delete " " and "-" and replace i "" without a space, and it's always a coincidence which will be " " or "-", so I need them both to work.
Code: Select all
For each, str in ["H e l l o", "Hello", "H-e-l-l-o"]
MsgBox,, Result, % "Input: " str "`n`nOutput: " internalTrim(str)
internalTrim(str) {
; Return RegExReplace(str, "[ -]")
; Return RegExReplace(str, "\W")
Return StrReplace(StrReplace(str, " ", ""), "-", "")
}
Thanks for help, I fixed that problem.mikeyww wrote: ↑06 Jul 2022, 06:13Code: Select all
For each, str in ["H e l l o", "Hello", "H-e-l-l-o"] MsgBox,, Result, % "Input: " str "`n`nOutput: " internalTrim(str) internalTrim(str) { ; Return RegExReplace(str, "[ -]") ; Return RegExReplace(str, "\W") Return StrReplace(StrReplace(str, " ", ""), "-", "") }