- Most notable is the .Save() and .Load() methods added to the System.Object class. This allows any object to be serialized to and from disk very rapidly e.g.:
(object)MyClass.Save(<FilePath>);
and
(MyClassDefinition)MyClass = (object)MyClass.Load(<FilePath>); - A series of extensions was added to the System.Double class allowing any number cast as a double to be quickly converted between binary data sizes e.g.:
double SizeInTB = 2;
double SizeInKB = SizeInTB.ToKB(Constants.NumberByte.TB);
Which will return 2,147,483,648 i.e. the number of KB in 2 TB. - A series of extensions was added to both the System.String and Sytem.Text.StringBuilder classes that make it easy to validate strong passwords e.g.:
string MyPassword = Console.Readline();
if (MyPassword.IsStrong())
{
//Pass. Input is a strong password.
}
else
{
//Fail. Input is NOT a strong password.
}
Even better is if you want to exclude say symbols or special characters requiring users to only use upper case, lower case and numbers, you can override the default parameters e.g.:
if (MyPassword.IsStrong(true, true, true, false))
The component methods of .IsStrong() can also be used independently e.g.
MyPassword.HasUpper()
MyPassword.HasLower()
MyPassword.HasNumeric()
MyPassword.HasSymbol() - A series of extensions was added to both the System.String and Sytem.Text.StringBuilder classes that make it easy to validate if a string is a valid US Zip code e.g.:
MyString.IsZipCode()
The method handles both 5 digit and 9 digit zip codes. - Extension methods was also added to make other string based operations easier e.g.
MyString.IsLower()
MyString.IsUpper() - Extension methods from previous versions were enhanced by adding the option to ignore white space as part of these methods:
MyString.IsAlphabetic()
MyString.IsAlphaNumeric()
MyString.IsNumeric() - On the lighter side of things, if you've ever wondered what it was like to live in the Morse Code era, you can leverage to silly methods to see for yourself like this:
"My message I want to send".ToMorseCode().MorseCodeBeep();
The SharePoint Knowledge Collection of Cornelius J. van Dyk, an 9 x SharePoint MVP
25 January 2021
Extensions 2.0.1 Major version update released!
18 January 2021
Extensions enhancement - RemoveExtraSpace() method added
" string truth = \"https://blog.cjvandyk.com ROCKS !!! \"".RemoveExtraSpace()
will return
"string truth = \"https://blog.cjvandyk.com ROCKS !!! \""
11 January 2021
Extensions enhancement - IsVowel() method added
The .IsVowel() method was added to the System.Char, System.String and System.Text.StringBuilder objects. It allows the developer the ability to check a substring for a vowel e.g.
"https://blog.cjvandyk.com ROCKS!!!".SubString(10, 1).IsVowel()
will return True because it's checking the "o" while
"https://blog.cjvandyk.com ROCKS!!!".SubString(11, 1).IsVowel()
04 January 2021
Extensions enhancement - IsZipCode() method added
The .IsZipCode() method was added to both the System.String and System.Text.StringBuilder objects. It allows the developer the ability to quickly check if a string is in valid US zip code format e.g.
"12345".IsZipCode()
will return True as will
"12345-6789".IsZipCode()
"12345678".IsZipCode()
SharePoint Remote Event Receivers are DEAD!!!
Well, the time has finally come. It was evident when Microsoft started pushing everyone to WebHooks, but this FAQ and related announcement...
-
Ever wondered what the new SharePoint Online URLs are all about? Take for example https://cjvandyk.sharepoint.us/:x:/r/sites/Site1... What ...
-
When using NuGet, we can easily run into assembly reference issues. A notorious error message is: CS0012: The type ‘System.Object’ is def...
-
Have you ever started creating a list view in SharePoint and because you're experimenting, you chose to make it a "Private" vi...