+92 332 4229 857 99ProjectIdeas@Gmail.com

String.Concat function (Vb.net)


String Concat function
String.Concat() function is used to concatenate strings. It concatenates as 
many number of strings as you want.
System.String is the library for this function.
 
Example1
Dim str1 As String = "Saad"
Dim str2 As String = "Saulat"
Dim str3 As String = "Bin"
Dim str4 As String = String.Empty
str4 = String.Concat(str1, " ", str3, " ", str2)
MsgBox(str4)
Result
Initially str4 is empty, but after the result of the concatenation of three strings, str1,str2 and str3, str4 will contain the concatenated result of these three strings. At the end str4 contains the value "Saad Bin Saulat".

Example2
Dim str As String = String.Empty
str = String.Concat(" A "" B "" C "" D "" E "" F "" G ")
MsgBox(str)
Result
Initially str is empty but after concatenation, str will contain the concatenated result which is "A B C D E F G".


Related articles

0 comments: