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

◆ StripSecondsFromPattern()

static string System.Globalization.CultureData.StripSecondsFromPattern ( string time)
inlinestaticprivate

Definition at line 1406 of file CultureData.cs.

1407 {
1408 bool flag = false;
1409 int num = -1;
1410 for (int i = 0; i < time.Length; i++)
1411 {
1412 if (time[i] == '\'')
1413 {
1414 flag = !flag;
1415 }
1416 else if (time[i] == '\\')
1417 {
1418 i++;
1419 }
1420 else
1421 {
1422 if (flag)
1423 {
1424 continue;
1425 }
1426 switch (time[i])
1427 {
1428 case 's':
1429 {
1430 if (i - num <= 4 && i - num > 1 && time[num + 1] != '\'' && time[i - 1] != '\'' && num >= 0)
1431 {
1432 i = num + 1;
1433 }
1434 bool containsSpace;
1436 time = string.Concat(str1: (!containsSpace) ? "" : " ", str0: time.AsSpan(0, i), str2: time.AsSpan(indexOfNextTokenAfterSeconds));
1437 break;
1438 }
1439 case 'H':
1440 case 'h':
1441 case 'm':
1442 num = i;
1443 break;
1444 }
1445 }
1446 }
1447 return time;
1448 }
static int GetIndexOfNextTokenAfterSeconds(string time, int index, out bool containsSpace)

References System.Globalization.CultureData.GetIndexOfNextTokenAfterSeconds().

Referenced by System.Globalization.CultureData.DeriveShortTimesFromLong().