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

◆ ParseCanonicalName()

static string System.DomainNameHelper.ParseCanonicalName ( string str,
int start,
int end,
ref bool loopback )
inlinestaticpackage

Definition at line 13 of file DomainNameHelper.cs.

14 {
15 string text = null;
16 for (int num = end - 1; num >= start; num--)
17 {
18 if (str[num] >= 'A' && str[num] <= 'Z')
19 {
20 text = str.Substring(start, end - start).ToLowerInvariant();
21 break;
22 }
23 if (str[num] == ':')
24 {
25 end = num;
26 }
27 }
28 if (text == null)
29 {
30 text = str.Substring(start, end - start);
31 }
32 if (text == "localhost" || text == "loopback")
33 {
34 loopback = true;
35 return "localhost";
36 }
37 return text;
38 }

References System.start, System.str, and System.text.

Referenced by System.Uri.CreateHostStringHelper(), and System.UncNameHelper.ParseCanonicalName().