AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

StringExtensions..::..SafeString Method

Returns the string value, or String if the string is null.

Namespace:  AdvantageCMS.Core.Common
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public static string SafeString(
	this string s
)

Parameters

s
Type: String
The string to safe-check.

Return Value

The original string, or an empty string if null.

Examples


C#
string name = null;
string safe = name.SafeString(); // returns ""
string greeting = "Hello".SafeString(); // returns "Hello"