Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AppendArgument() [2/2]

static void System.PasteArguments.AppendArgument ( ref ValueStringBuilder stringBuilder,
string argument )
inlinestaticpackage

Definition at line 8 of file PasteArguments.cs.

9 {
10 if (stringBuilder.Length != 0)
11 {
12 stringBuilder.Append(' ');
13 }
15 {
16 stringBuilder.Append(argument);
17 return;
18 }
19 stringBuilder.Append('"');
20 int num = 0;
21 while (num < argument.Length)
22 {
23 char c = argument[num++];
24 switch (c)
25 {
26 case '\\':
27 {
28 int num2 = 1;
29 while (num < argument.Length && argument[num] == '\\')
30 {
31 num++;
32 num2++;
33 }
34 if (num == argument.Length)
35 {
36 stringBuilder.Append('\\', num2 * 2);
37 }
38 else if (argument[num] == '"')
39 {
40 stringBuilder.Append('\\', num2 * 2 + 1);
41 stringBuilder.Append('"');
42 num++;
43 }
44 else
45 {
46 stringBuilder.Append('\\', num2);
47 }
48 break;
49 }
50 case '"':
51 stringBuilder.Append('\\');
52 stringBuilder.Append('"');
53 break;
54 default:
55 stringBuilder.Append(c);
56 break;
57 }
58 }
59 stringBuilder.Append('"');
60 }
static bool ContainsNoWhitespaceOrQuotes(string s)

References System.PasteArguments.ContainsNoWhitespaceOrQuotes().