# IfNullOrEmpty Method Replaces a null or empty string with a specified replacement string. ## Definition **Namespace:** CapyKit.Extensions **Assembly:** CapyKit (in CapyKit.dll) Version: 1.0.0+6cdd805be49c3b769a116584ea6904955ecd820d **C#** ``` C# public static string IfNullOrEmpty( this string value, string replacement ) ``` **VB** ``` VB Public Shared Function IfNullOrEmpty ( value As String, replacement As String ) As String ``` **C++** ``` C++ public: [ExtensionAttribute] static String^ IfNullOrEmpty( String^ value, String^ replacement ) ``` **F#** ``` F# [] static member IfNullOrEmpty : value : string * replacement : string -> string ``` #### Parameters
  String
The original string.
  String
The replacement string.
#### Return Value String The original string if not null or empty, otherwise the replacement string. #### Usage Note In Visual Basic and C#, you can call this method as an instance method on any object of type String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide). ## See Also #### Reference StringExtensions Class CapyKit.Extensions Namespace IsNullOrEmpty(String)