Ah! I found it, sorry for bothering :)
public StringToCorrectString2(s: string) : string
{
match(s) {
| null
| Length = 0 => s;
| _ when (s[0] == '=')
| _ when (s[0] == '\'') => "'" + s;
| _ => s;
}
}