Truncates the string from left side

image_pdfimage_print

//Microsoft Public License (Ms-PL)
//http://visualizer.codeplex.com/license

using System;
using System.Collections.Generic;

namespace Redwerb.BizArk.Core.StringExt
{
///

/// Provides extension methods for strings.
///

public static class StringExt
{
///

/// Truncates the string.
///

/// /// ///
public static string Left(this string str, int length)
{
if (str == null) return null;
if (str.Length <= length) return str; return str.Substring(0, length); } } } [/csharp]

This entry was posted in Data Types. Bookmark the permalink.