I found this online:
My question is, what is the advantage of using concatenate and copy over something like this:Code:'The following source code concatenate two strings. Dim str1 As String = "ppp" Dim str2 As String = "ccc" Dim strRes As String = String.Concat(str1, str2) Console.WriteLine(strRes) 'The following source code concatenates one string and one object. Dim obj As Object = 12 strRes = String.Concat(str1, obj) Console.WriteLine(strRes) 'The Copy method copies contents of a string to another. The Copy method takes a string as input and returns another string with the same contents as the input string. For example, the following code copies str1 to strRes. strRes = String.Copy(str1) Console.WriteLine("Copy result :" + strRes)
Thanks.Code:'concatenate Console.WriteLine(str1 + str2) 'copy strRes = str1 Console.WriteLine(strRes)




Reply With Quote