22
umbraco/datalayer/StringExtensions.cs
Normal file
22
umbraco/datalayer/StringExtensions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace umbraco.DataLayer
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// This trims all white spaces from beginning and end of the string and removes any line breaks (repacing with a space)
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string TrimToOneLine(this string str)
|
||||
{
|
||||
return str.Replace(Environment.NewLine, " ").Trim();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user