Have looked at RegExReplace() and tried to find the function I'm looking for.
Tried step by step, until it became an acceptable result. (Tried to use (* ANYCRLF) but get stuck.)
Here is a result .:
Code: Select all
#SingleInstance force
#NoEnv
vText = " `t This `nis, "only" a small `ntest. "
Str := RegExReplace(vText, "^\""", "") ; Remove "" in the beginning
Str := RegExReplace(Str, "\""$", "") ; Remove "" at the end
Str := RegExReplace(Str, "`n") ; Remove all newlines
; Str := RegExReplace(Str, "`r") ; Remove all newlines
Str1 := RegExReplace(Str, "^ +", "") ; Remove spaces in the beginning
Str1 := RegExReplace(Str1, " +$", "") ; Remove spaces at the end
Str2 := RegExReplace(Str1, "`t", "") ; Remove all tabs
Str3 := RegExReplace(Str2, "\x20{2,}", " ") ; keep only one space between the words
MsgBox 64, Row.: %A_LineNumber% -> %A_ScriptName%, % "vText .: -" vText "-`n`nStr .: -" Str "-`nStr1 .: -" Str1 "-`nStr2 .: -" Str2 "-`nStr3 .: -" Str3 "-"
ExitApp