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. How to find index of character or substring in a string class

How to find index of character or substring in a string class

Scheduled Pinned Locked Moved C#
csharptutorialdatabasedotnet
8 Posts 6 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.
  • M Offline
    M Offline
    Mushtaque Nizamani
    wrote on last edited by
    #1

    Hi, I am new to C# and .Net Framework, can any one please tell how to find index of character in string. for example: string myteststring = "abc,def"; then here can i find the index of char ",". Warm Regards, Mushq

    M L 2 Replies Last reply
    0
    • M Mushtaque Nizamani

      Hi, I am new to C# and .Net Framework, can any one please tell how to find index of character in string. for example: string myteststring = "abc,def"; then here can i find the index of char ",". Warm Regards, Mushq

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Use the IndexOf method from the string class All the best Martin

      1 Reply Last reply
      0
      • M Mushtaque Nizamani

        Hi, I am new to C# and .Net Framework, can any one please tell how to find index of character in string. for example: string myteststring = "abc,def"; then here can i find the index of char ",". Warm Regards, Mushq

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        You could try the string's method .IndexOf :)

        VirtualVoid**.NET**

        N 1 Reply Last reply
        0
        • L Lost User

          You could try the string's method .IndexOf :)

          VirtualVoid**.NET**

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          How is your response different than the one posted two hours before you?


          only two letters away from being an asset

          S E 2 Replies Last reply
          0
          • N Not Active

            How is your response different than the one posted two hours before you?


            only two letters away from being an asset

            S Offline
            S Offline
            Stefan Troschuetz
            wrote on last edited by
            #5

            Mark Nischalke wrote:

            How is your response different than the one posted two hours before you?

            Maybe it took him that long to come up with the solution, so he could not see someone else already answered the question :laugh:


            "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

            www.troschuetz.de

            L 1 Reply Last reply
            0
            • N Not Active

              How is your response different than the one posted two hours before you?


              only two letters away from being an asset

              E Offline
              E Offline
              Eric Dahlvang
              wrote on last edited by
              #6

              Mark Nischalke wrote:

              How is your response different than the one posted two hours before you?

              Actually, it was only one hour and 59 minutes.

              --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

              1 Reply Last reply
              0
              • S Stefan Troschuetz

                Mark Nischalke wrote:

                How is your response different than the one posted two hours before you?

                Maybe it took him that long to come up with the solution, so he could not see someone else already answered the question :laugh:


                "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

                www.troschuetz.de

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                i didn't noticed that someone already answered... don't be silly, everyone can make mistake, or you're the god ?!

                VirtualVoid**.NET**

                S 1 Reply Last reply
                0
                • L Lost User

                  i didn't noticed that someone already answered... don't be silly, everyone can make mistake, or you're the god ?!

                  VirtualVoid**.NET**

                  S Offline
                  S Offline
                  Stefan Troschuetz
                  wrote on last edited by
                  #8

                  Relax man, it was just a joke (my posting is marked as such with intend).


                  "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

                  www.troschuetz.de

                  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