This documentation is archived and is not being maintained.

String.Concat Method (String, String, String, String)

.NET Framework 1.1

Concatenates four specified instances of String.

[Visual Basic]
Overloads Public Shared Function Concat( _
   ByVal str0 As String, _
   ByVal str1 As String, _
   ByVal str2 As String, _
   ByVal str3 As String _
) As String
public static string Concat(
 string str0,
 string str1,
 string str2,
 string str3
public: static String* Concat(
 String* str0,
 String* str1,
 String* str2,
 String* str3
public static function Concat(
   str0 : String,
 str1 : String,
 str2 : String,
 str3 : String
) : String;


The first String.
The second String.
The third String.
The fourth String.

Return Value

The concatenation of str0, str1, str2, and str3.


An Empty string is used in place of any null object in the array.


[Visual Basic, C#, C++] In the following code example the DataBinding output is generated using this Concat method.

[Visual Basic] 
myDataBindingCollection = DataBindings
myEnumerator = myDataBindingCollection.GetEnumerator()
While myEnumerator.MoveNext()

   myDataBinding2 = CType(myEnumerator.Current, DataBinding)
   Dim dataBindingOutput1, dataBindingOutput2, dataBindingOutput3 As [String]
   dataBindingOutput1 = [String].Concat("The property name is ", myDataBinding2.PropertyName)
   dataBindingOutput2 = [String].Concat("The property type is ", myDataBinding2.PropertyType.ToString(), "-", dataBindingOutput1)
   dataBindingOutput3 = [String].Concat("The expression is ", myDataBinding2.Expression, "-", dataBindingOutput2)

   myDataBindingExpression2 = [String].Concat("<%#", myDataBinding2.Expression, "%>")
   myStringReplace2 = myDataBinding2.PropertyName.Replace(".", "-")
   myHtmlControlDesignBehavior.SetAttribute(myStringReplace2, myDataBindingExpression2, True)
   Dim index As Integer = myStringReplace2.IndexOf("-"c)
End While ' while loop ends

myDataBindingCollection = DataBindings;
myEnumerator = myDataBindingCollection.GetEnumerator();

   myDataBinding2 = (DataBinding)myEnumerator.Current;
   String dataBindingOutput1,dataBindingOutput2,dataBindingOutput3;
   dataBindingOutput1=String.Concat("The property name is ",myDataBinding2.PropertyName);
   dataBindingOutput2=String.Concat("The property type is ",myDataBinding2.PropertyType.ToString(),"-",dataBindingOutput1);
   dataBindingOutput3=String.Concat("The expression is ",myDataBinding2.Expression,"-",dataBindingOutput2);
   myDataBindingExpression2 = String.Concat("<%#",myDataBinding2.Expression,"%>");
   myStringReplace2 = myDataBinding2.PropertyName.Replace(".","-");
   int index = myStringReplace2.IndexOf('-');
}// while loop ends

myDataBindingCollection = DataBindings;
myEnumerator = myDataBindingCollection->GetEnumerator();

    myDataBinding2 = dynamic_cast<DataBinding*>(myEnumerator->Current);
    String* dataBindingOutput1;
    String* dataBindingOutput2;
    String* dataBindingOutput3;

    dataBindingOutput1=String::Concat(S"The property name is ", myDataBinding2->PropertyName);
    dataBindingOutput2=String::Concat(S"The property type is ", myDataBinding2->PropertyType->ToString(), S"-",dataBindingOutput1);
    dataBindingOutput3=String::Concat(S"The expression is ", myDataBinding2->Expression,S"-", dataBindingOutput2);
    myDataBindingExpression2 = String::Concat(S"<%#", myDataBinding2->Expression,S"%>");
    myStringReplace2 = myDataBinding2->PropertyName->Replace(S".",S"-");
    myHtmlControlDesignBehavior->SetAttribute(myStringReplace2, myDataBindingExpression2, true);
    int index = myStringReplace2->IndexOf('-');
}// while loop ends

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

String Class | String Members | System Namespace | String.Concat Overload List | Join