@@ -21,63 +21,43 @@ public static T GetResultOrDefault<T>(this Task<T> task, T defaultValue = defaul
2121 }
2222 return defaultValue ;
2323 }
24- public static string WrapUp ( this string self , string wrapLeft = "\" " , string wrapRight = null )
25- {
26- return wrapLeft + self + ( wrapRight ?? wrapLeft ) ;
27- }
28- public static string [ ] SplitLines ( this string self )
29- {
30- return self . Split ( new [ ] { '\n ' , '\r ' } , RemoveEmptyEntries ) ;
31- }
32- public static string Join ( this IEnumerable < string > values )
33- {
34- return string . Join ( string . Empty , values ) ;
35- }
36- public static string Join ( this IEnumerable < string > values , char separator )
37- {
38- return string . Join ( separator , values ) ;
39- }
40- public static string Join ( this IEnumerable < string > values , string separator )
41- {
42- return string . Join ( separator , values ) ;
43- }
24+
25+ public static string WrapUp ( this string self , string wrapLeft = "\" " , string wrapRight = null ) => wrapLeft + self + ( wrapRight ?? wrapLeft ) ;
26+
27+ public static string [ ] SplitLines ( this string self ) => self . Split ( new [ ] { '\n ' , '\r ' } , RemoveEmptyEntries ) ;
28+
29+ public static string Join ( this IEnumerable < string > values ) => string . Join ( string . Empty , values ) ;
30+ public static string Join ( this IEnumerable < string > values , char separator ) => string . Join ( separator , values ) ;
31+ public static string Join ( this IEnumerable < string > values , string separator ) => string . Join ( separator , values ) ;
32+
4433 public static int GetCombinedHashCode ( this IEnumerable < object > values )
4534 {
4635 int hash = 0 ;
4736 foreach ( var value in values )
4837 hash ^= value . GetHashCode ( ) ;
4938 return hash ;
5039 }
40+
5141 public static string AfterLast ( this string self , char separator )
5242 {
5343 var index = self . LastIndexOf ( separator ) ;
5444 return index == - 1 ? self : self [ ( index + 1 ) ..] ;
5545 }
46+
5647 public static string AfterFirst ( this string self , char separator )
5748 {
5849 var index = self . IndexOf ( separator ) ;
5950 return index == - 1 ? self : self [ ( index + 1 ) ..] ;
6051 }
61- public static string NormalizeSlashes ( this string self )
62- {
63- return self . Replace ( '\\ ' , '/' ) ;
64- }
65- public static T When < T > ( this T self , bool condition )
66- {
67- return condition ? self : default ;
68- }
69- public static Vector2 To0Y ( this int self )
70- {
71- return new Vector2 ( 0 , self ) ;
72- }
73- public static Rect Move ( this Rect rect , float x , float y )
74- {
75- return new Rect ( rect . x + x , rect . y + y , rect . width , rect . height ) ;
76- }
77- public static Rect Resize ( this Rect rect , float width , float height )
78- {
79- return new Rect ( rect . x , rect . y , width , height ) ;
80- }
52+
53+ public static string NormalizeSlashes ( this string self ) => self . Replace ( '\\ ' , '/' ) ;
54+
55+ public static T When < T > ( this T self , bool condition ) => condition ? self : default ;
56+
57+ public static Vector2 To0Y ( this int self ) => new Vector2 ( 0 , self ) ;
58+
59+ public static Rect Move ( this Rect rect , float x , float y ) => new Rect ( rect . x + x , rect . y + y , rect . width , rect . height ) ;
60+ public static Rect Resize ( this Rect rect , float width , float height ) => new Rect ( rect . x , rect . y , width , height ) ;
8161
8262 public static async Task < T > AfterCompletion < T > ( this Task < T > task , params Action [ ] actions )
8363 {
0 commit comments