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. C#
  4. String Manipulation

String Manipulation

Scheduled Pinned Locked Moved C#
csharptutorialquestion
6 Posts 6 Posters 1 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.
  • S Offline
    S Offline
    Senu Gandhi
    wrote on last edited by
    #1

    Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil

    C L 2 Replies Last reply
    0
    • S Senu Gandhi

      Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      Z P 2 Replies Last reply
      0
      • C Christian Graus

        If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        Z Offline
        Z Offline
        zhongyougang gmail com
        wrote on last edited by
        #3

        Excellent reply!:-D

        1 Reply Last reply
        0
        • S Senu Gandhi

          Hi all, In VB.Net Dim strTemp as string strTemp = "today is " _ & " Saturday " How to do the above in C#.Net? Thanks Senthil

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

          And we thank mister Semi Colon for that.

          Luc Pattyn [Forum Guidelines] [My Articles]


          this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


          1 Reply Last reply
          0
          • C Christian Graus

            If you can;t work that out, you should be doing a very basic tutorial in C#, or buying a book. string strTemp; strTemp = "today is Saturday"; strTemp = "today is " + "Saturday"; string temp = "today is Saturday, and Microsoft no longer recommends Hungarian notation"; Note, C# doesn't have the stupid rule where you need a special character to show code goes over two lines.

            Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            Or even:

            string today = "Saturday" ;
            string temp = string.Format ( "Today is {0}" , today ) ;

            P 1 Reply Last reply
            0
            • P PIEBALDconsult

              Or even:

              string today = "Saturday" ;
              string temp = string.Format ( "Today is {0}" , today ) ;

              P Offline
              P Offline
              Paul Conrad
              wrote on last edited by
              #6

              Yes, using string.Format is good. Seems I've been going down that road lately :-D

              "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

              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