179
180
if (chCode === CharCode.Backslash) {
182
>
// move to next char
183
>
i++;
184
>
185
>
if (i >= len) {
186
// string ends with a \
187
break;
188
}
190
>
const nextChCode = replaceString.charCodeAt(i);
191
>
let replaceWithCharacter: string | null = null;
192
>
193
>
switch (nextChCode) {
194
>
case CharCode.Backslash:
195
// \\ => \
196
replaceWithCharacter = '\\';
197
break;
199
// \n => LF
200
replaceWithCharacter = '\n';
201
break;
203
// \t => TAB
204
replaceWithCharacter = '\t';
205
break;
207
>
208
>
if (replaceWithCharacter) {
209
result += replaceString.substring(substrFrom, i - 1) + replaceWithCharacter;
210
substrFrom = i + 1;
211
}
213
214
if (chCode === CharCode.DollarSign) {