-
-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
V2.0.11
- Loading branch information
zzzprojects
committed
Apr 19, 2017
1 parent
5591617
commit 640673a
Showing
6 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,4 @@ public static Byte Max(this Byte val1, Byte val2) | |
{ | ||
return Math.Max(val1, val2); | ||
} | ||
R | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Description: C# Extension Methods Library to enhances the .NET Framework by adding hundreds of new methods. It drastically increases developers productivity and code readability. Support C# and VB.NET | ||
// Website & Documentation: https://github.com/zzzprojects/Z.ExtensionMethods | ||
// Forum: https://github.com/zzzprojects/Z.ExtensionMethods/issues | ||
// License: https://github.com/zzzprojects/Z.ExtensionMethods/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
using System; | ||
|
||
public static partial class Extensions | ||
{ | ||
/// <summary> | ||
/// A string extension method that converts the @this to a valid date time or null. | ||
/// </summary> | ||
/// <param name="this">The @this to act on.</param> | ||
/// <returns>@this as a DateTime?</returns> | ||
public static DateTime? ToValidDateTimeOrNull(this string @this) | ||
{ | ||
DateTime date; | ||
|
||
if (DateTime.TryParse(@this, out date)) | ||
{ | ||
return date; | ||
} | ||
|
||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Description: C# Extension Methods Library to enhances the .NET Framework by adding hundreds of new methods. It drastically increases developers productivity and code readability. Support C# and VB.NET | ||
// Website & Documentation: https://github.com/zzzprojects/Z.ExtensionMethods | ||
// Forum: https://github.com/zzzprojects/Z.ExtensionMethods/issues | ||
// License: https://github.com/zzzprojects/Z.ExtensionMethods/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Z.Core.Test | ||
{ | ||
[TestClass] | ||
public class System_String_IsValidEmail | ||
{ | ||
[TestMethod] | ||
public void IsValidEmail() | ||
{ | ||
{ | ||
// Type | ||
string @this = "[email protected]"; | ||
|
||
// Exemples | ||
var result = @this.IsValidEmail(); // return true; | ||
|
||
// Unit Test | ||
Assert.IsTrue(result); | ||
} | ||
|
||
{ | ||
// Type | ||
string @this = "[email protected]"; | ||
|
||
// Exemples | ||
var result = @this.IsValidEmail(); // return true; | ||
|
||
// Unit Test | ||
Assert.IsTrue(result); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters