|
6 | 6 | <br/>
|
7 | 7 |
|
8 | 8 | # FluentExtensions
|
9 |
| -Fluent Extensions is a set of more than 70 .NET extensions, it especially made for helping developers to focus on the main tasks rather than get distracted by writing the same code again and again. |
| 9 | +Fluent Extensions is a set of more than 80 .NET extensions, it especially made for helping developers to focus on the main tasks rather than get distracted by writing the same code again and again. |
10 | 10 |
|
11 | 11 | ### Install FluentExtensions via NuGet
|
12 | 12 |
|
@@ -91,6 +91,20 @@ string RandomDigits(this int length);
|
91 | 91 |
|
92 | 92 | // Generating Random Numbers.
|
93 | 93 | string GenerateRandomString(this int length, bool isUpperCase = false, bool containNumbers = false);
|
| 94 | + |
| 95 | +// Converts given number to kilobytes. |
| 96 | +double ToKB(this int number, DigitalStorage from = DigitalStorage.KB); |
| 97 | + |
| 98 | +// Converts given number to megabytes. |
| 99 | +double ToMB(this int number, DigitalStorage from = DigitalStorage.MB); |
| 100 | + |
| 101 | +// Converts the given number to gigabytes. |
| 102 | +double ToGB(this int number, DigitalStorage from = DigitalStorage.GB); |
| 103 | + |
| 104 | +// Converts the given number to terabytes. |
| 105 | +double ToTB(this int number, DigitalStorage from = DigitalStorage.TB) |
| 106 | + |
| 107 | + |
94 | 108 | ```
|
95 | 109 |
|
96 | 110 | #### Extensions to Strings
|
@@ -165,6 +179,21 @@ string ReadFromDisk(this string path);
|
165 | 179 |
|
166 | 180 | // Gets the content of the text file asynchronously.
|
167 | 181 | Task<string> ReadFromDiskAsync(this string path);
|
| 182 | + |
| 183 | +// Adds text to end of another text. |
| 184 | +string AddToEnd(this string text, string textToAdd, bool addSpaceBeforeAddition = true); |
| 185 | + |
| 186 | +// Adds text to start of another text. |
| 187 | +string AddToStart(this string text, string textToAdd, bool addSpaceAfterAddition = true); |
| 188 | + |
| 189 | +// Gets portion of string based on given characters and position to get. |
| 190 | +string Take(this string source, int characters, Position from = Position.Start); |
| 191 | + |
| 192 | +// Replaces multiple values inside a string with one value. |
| 193 | +string ReplaceMultipleWithOne(this string source, string[] values, string value); |
| 194 | + |
| 195 | + |
| 196 | + |
168 | 197 | ```
|
169 | 198 |
|
170 | 199 | #### Extensions to DateTime
|
|
0 commit comments