//Microsoft Public License (Ms-PL)
//http://visualizer.codeplex.com/license
using System;
using System.Collections.Generic;
namespace Redwerb.BizArk.Core.StringExt
{
///
///
public static class StringExt
{
///
///
///
///
///
public static string Max(this string str, int max)
{
return Max(str, max, false);
}
///
///
///
///
///
///
public static string Max(this string str, int max, bool ellipses)
{
if (str == null) return null;
if (str.Length <= max) return str; if (ellipses) return str.Substring(0, max - 3) + "..."; else return str.Substring(0, max); } } } [/csharp]