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 Catch the 2 or 3 first char in the begining of the string

How to Catch the 2 or 3 first char in the begining of the string

Scheduled Pinned Locked Moved C#
tutorial
4 Posts 3 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.
  • A Offline
    A Offline
    Assaf82
    wrote on last edited by
    #1

    hello I want to catch any value in the datareader begin with a special string Sysdiagrams, if i the value begin with cath it'll be rejected any idea will greatly appreciated Thanks in advance

    Assaf

    R G 2 Replies Last reply
    0
    • A Assaf82

      hello I want to catch any value in the datareader begin with a special string Sysdiagrams, if i the value begin with cath it'll be rejected any idea will greatly appreciated Thanks in advance

      Assaf

      R Offline
      R Offline
      rao raja
      wrote on last edited by
      #2

      you may use the string as an array ... like arrayName[indexValue]... and 2nd option is use a char pointer..and again you can manipulate is as an array rao

      1 Reply Last reply
      0
      • A Assaf82

        hello I want to catch any value in the datareader begin with a special string Sysdiagrams, if i the value begin with cath it'll be rejected any idea will greatly appreciated Thanks in advance

        Assaf

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        The obvious choise would be to filter out the records in the SQL query, so that the don't end up in the result in the first place. If you absolutely don't want to do that, you can use the StartsWith method of the string class.

        Experience is the sum of all the mistakes you have done.

        A 1 Reply Last reply
        0
        • G Guffa

          The obvious choise would be to filter out the records in the SQL query, so that the don't end up in the result in the first place. If you absolutely don't want to do that, you can use the StartsWith method of the string class.

          Experience is the sum of all the mistakes you have done.

          A Offline
          A Offline
          Assaf82
          wrote on last edited by
          #4

          Thanks StarWith is the choice

          Assaf

          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