Click or drag to resize

StringHelperAppendIf Method (String, Boolean, String)

Appends toAdd to contents, if condition is true.

Namespace:  Bootstrap.A11y.Helpers
Assembly:  Bootstrap.A11y (in Bootstrap.A11y.dll) Version: 1.1.0.0 (1.1.0.0)
Syntax
C#
public static string AppendIf(
	string contents,
	bool condition,
	string toAdd
)

Parameters

contents
Type: SystemString
The base text to be returned no matter what.
condition
Type: SystemBoolean
The condition to check.
toAdd
Type: SystemString
The additional string to append if not empty.

Return Value

Type: String
If condition is true, toAdd is appended to contents. Otherwise (condition is false), contents is returned unchanged.
See Also