Replace instead of ReplaceAll

This commit is contained in:
Sam Harwell 2013-02-17 15:02:21 -06:00
parent 80a8cdd773
commit 1632053432
3 changed files with 9 additions and 9 deletions

View File

@ -270,9 +270,9 @@ namespace Antlr4.Runtime
string txt = Text; string txt = Text;
if (txt != null) if (txt != null)
{ {
txt = txt.ReplaceAll("\n", "\\\\n"); txt = txt.Replace("\n", "\\n");
txt = txt.ReplaceAll("\r", "\\\\r"); txt = txt.Replace("\r", "\\r");
txt = txt.ReplaceAll("\t", "\\\\t"); txt = txt.Replace("\t", "\\t");
} }
else else
{ {

View File

@ -506,9 +506,9 @@ namespace Antlr4.Runtime
protected internal virtual string EscapeWSAndQuote(string s) protected internal virtual string EscapeWSAndQuote(string s)
{ {
// if ( s==null ) return s; // if ( s==null ) return s;
s = s.ReplaceAll("\n", "\\\\n"); s = s.Replace("\n", "\\n");
s = s.ReplaceAll("\r", "\\\\r"); s = s.Replace("\r", "\\r");
s = s.ReplaceAll("\t", "\\\\t"); s = s.Replace("\t", "\\t");
return "'" + s + "'"; return "'" + s + "'";
} }

View File

@ -148,9 +148,9 @@ namespace Antlr4.Runtime
s = "<" + t.Type + ">"; s = "<" + t.Type + ">";
} }
} }
s = s.ReplaceAll("\n", "\\\\n"); s = s.Replace("\n", "\\n");
s = s.ReplaceAll("\r", "\\\\r"); s = s.Replace("\r", "\\r");
s = s.ReplaceAll("\t", "\\\\t"); s = s.Replace("\t", "\\t");
return "'" + s + "'"; return "'" + s + "'";
} }