I have to concate two strings by operator "/"
-
Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?
Dim str3 as string = str1 + "/" + str2
-
Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?
Are you serious? This is such a beginner-level question and you have been around these forums for some time now. I find it hard to believe that you do not know how to do this. Still. There are several ways to do this. You could use the
String.Concat()
method, look up the documentation. You could use aStringBuilder
instance with theAppend()
method, again, look up the documentation. You could simply use the&
operator or the+
operator, LUTD. There are many, many more ways but I think these are the most common.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?
There are different ways; The simplest is;
Dim x As String = "Fred"
Dim y As String = "Smith"
Dim z As String
z = x + "/" + yor
Dim x As String = "Fred" Dim y As String = "Smith" Dim z As String z = x & "/" & y
If you look up the string class in the documentation, there are others ways to do this also; including, concat, join. You can also use a stringbuilder like;
Dim newString As New System.Text.StringBuilder newString.Append(x) newString.Append("/") newString.Append(y) Debug.WriteLine(newString)
-
Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?
VB.NET has the almighty & operator for problems like this. It it too bad there are no books nor on-line documentation to tell you that. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages