-
Notifications
You must be signed in to change notification settings - Fork 0
Object Extensions
StrutTower edited this page Nov 18, 2023
·
4 revisions
Detects any string properties on the object and runs the SafeTrim() function on them. Does not run recursively.
Person person = new() {
FirstName = " John ",
LastName = "Smith "
};
person.TrimProperties();
// person.FirstName == "John"
// person.LastName == "Smith"Check if the object is a List<> without checking the generic type of the list
List<Person> people = new();
bool isList = people.IsGenericList();
// returns true;
string testString = "Test String;
bool isList = testString.IsGenericList();
// returns false;