@@ -24,76 +24,6 @@ public static string GetReadableSize(double size)
2424 return $ "{ size : # ###.##} { sizes [ order ] } ". TrimStart ( ) ;
2525 }
2626
27- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
28- public static string SubstringBefore ( this string s , char delimiter )
29- {
30- var index = s . IndexOf ( delimiter ) ;
31- return index == - 1 ? s : s [ ..index ] ;
32- }
33-
34- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
35- public static string SubstringBefore ( this string s , string delimiter , StringComparison comparisonType = StringComparison . Ordinal )
36- {
37- var index = s . IndexOf ( delimiter , comparisonType ) ;
38- return index == - 1 ? s : s [ ..index ] ;
39- }
40-
41- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
42- public static string SubstringAfter ( this string s , char delimiter )
43- {
44- var index = s . IndexOf ( delimiter ) ;
45- return index == - 1 ? s : s . Substring ( index + 1 , s . Length - index - 1 ) ;
46- }
47-
48- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
49- public static string SubstringAfter ( this string s , string delimiter , StringComparison comparisonType = StringComparison . Ordinal )
50- {
51- var index = s . IndexOf ( delimiter , comparisonType ) ;
52- return index == - 1 ? s : s . Substring ( index + delimiter . Length , s . Length - index - delimiter . Length ) ;
53- }
54-
55- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
56- public static string SubstringBeforeLast ( this string s , char delimiter )
57- {
58- var index = s . LastIndexOf ( delimiter ) ;
59- return index == - 1 ? s : s [ ..index ] ;
60- }
61-
62- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
63- public static string SubstringBeforeLast ( this string s , string delimiter , StringComparison comparisonType = StringComparison . Ordinal )
64- {
65- var index = s . LastIndexOf ( delimiter , comparisonType ) ;
66- return index == - 1 ? s : s [ ..index ] ;
67- }
68-
69- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
70- public static string SubstringBeforeWithLast ( this string s , char delimiter )
71- {
72- var index = s . LastIndexOf ( delimiter ) ;
73- return index == - 1 ? s : s [ ..( index + 1 ) ] ;
74- }
75-
76- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
77- public static string SubstringBeforeWithLast ( this string s , string delimiter , StringComparison comparisonType = StringComparison . Ordinal )
78- {
79- var index = s . LastIndexOf ( delimiter , comparisonType ) ;
80- return index == - 1 ? s : s [ ..( index + 1 ) ] ;
81- }
82-
83- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
84- public static string SubstringAfterLast ( this string s , char delimiter )
85- {
86- var index = s . LastIndexOf ( delimiter ) ;
87- return index == - 1 ? s : s . Substring ( index + 1 , s . Length - index - 1 ) ;
88- }
89-
90- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
91- public static string SubstringAfterLast ( this string s , string delimiter , StringComparison comparisonType = StringComparison . Ordinal )
92- {
93- var index = s . LastIndexOf ( delimiter , comparisonType ) ;
94- return index == - 1 ? s : s . Substring ( index + delimiter . Length , s . Length - index - delimiter . Length ) ;
95- }
96-
9727 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
9828 public static int GetNameLineNumber ( this string s , string lineToFind )
9929 {
0 commit comments