Advertisement
TopFloorSolutions

Nut String Extension Methods

Jan 19th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. namespace Nut.Base
  2. {
  3.     public static class StringExt
  4.     {
  5.         /// <summary>
  6.         /// Checks to see if a string is null or empty.
  7.         /// </summary>
  8.         /// <param name="x"></param>
  9.         /// <returns></returns>
  10.         public static bool CheckIfStringHasValue(this string x) => string.IsNullOrEmpty(x) ? true : false;
  11.  
  12.         /// <summary>
  13.         /// Get the length of a string.
  14.         /// </summary>
  15.         /// <param name="x"></param>
  16.         /// <returns></returns>
  17.         public static int GetStringLength(this string x) => x.Length;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement