Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. I have to concate two strings by operator "/"

I have to concate two strings by operator "/"

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    KIDYA
    wrote on last edited by
    #1

    Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?

    P H D L 4 Replies Last reply
    0
    • K KIDYA

      Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?

      P Offline
      P Offline
      Padmaraj Sivaraj
      wrote on last edited by
      #2

      Dim str3 as string = str1 + "/" + str2

      1 Reply Last reply
      0
      • K KIDYA

        Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        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 a StringBuilder instance with the Append() 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.”

        1 Reply Last reply
        0
        • K KIDYA

          Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?

          D Offline
          D Offline
          DaveAuld
          wrote on last edited by
          #4

          There are different ways; The simplest is;

          Dim x As String = "Fred"
          Dim y As String = "Smith"
          Dim z As String
          z = x + "/" + y

          or

              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)
          

          Dave Who am I?: Web|Facebook|Twitter|LinkedIn|Bebo

          1 Reply Last reply
          0
          • K KIDYA

            Hello Experts, I want result in this format->Smart/Kidya. where, Str1=Smart Str2=Kidya How to do with VB.Net?

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            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


            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups