Initial Commit
This commit is contained in:
17
Utils/Strings.cs
Normal file
17
Utils/Strings.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
public static class Strings
|
||||
{
|
||||
public static string Truncate(this string value, int maxLength)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) return value;
|
||||
return value.Length <= maxLength ? value : value.Substring(0, maxLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user