Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
StringExtensions.cs
Go to the documentation of this file.
1
namespace
System
;
2
3
internal
static
class
StringExtensions
4
{
5
internal
static
string
SubstringTrim
(
this
string
value
,
int
startIndex
,
int
length
)
6
{
7
if
(
length
== 0)
8
{
9
return
string
.Empty;
10
}
11
int
num =
startIndex
+
length
- 1;
12
while
(
startIndex
<= num &&
char
.IsWhiteSpace(
value
[
startIndex
]))
13
{
14
startIndex
++;
15
}
16
while
(num >=
startIndex
&&
char
.IsWhiteSpace(
value
[num]))
17
{
18
num--;
19
}
20
int
num2 = num -
startIndex
+ 1;
21
if
(num2 != 0)
22
{
23
if
(num2 !=
value
.Length)
24
{
25
return
value
.Substring(
startIndex
, num2);
26
}
27
return
value
;
28
}
29
return
string
.Empty;
30
}
31
}
System.StringExtensions.SubstringTrim
static string SubstringTrim(this string value, int startIndex, int length)
Definition
StringExtensions.cs:5
System.ExceptionArgument.startIndex
@ startIndex
System.ExceptionArgument.value
@ value
System.ExceptionArgument.length
@ length
System
Definition
BlockingCollection.cs:8
source
System.Net.WebHeaderCollection
System
StringExtensions.cs
Generated by
1.10.0