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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. search for special sentence in a whole string?

search for special sentence in a whole string?

Scheduled Pinned Locked Moved C#
tutorialquestion
3 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

    If i want to search for sentence in a whole string how i can do? Ex: str ="SELECT Currency.CurrCode, Currency.CurrName FROM CurRate INNER JOIN Currency ON CurRate.Code = Currency.CurrCode" I want to check if CurrCode exist or not ? and how to check from the case sensitive Thanks a lot

    Assaf

    L G 2 Replies Last reply
    0
    • A Assaf82

      If i want to search for sentence in a whole string how i can do? Ex: str ="SELECT Currency.CurrCode, Currency.CurrName FROM CurRate INNER JOIN Currency ON CurRate.Code = Currency.CurrCode" I want to check if CurrCode exist or not ? and how to check from the case sensitive Thanks a lot

      Assaf

      L Offline
      L Offline
      leoiser
      wrote on last edited by
      #2

      There are few methods to case sensative searches convert or cast the search field to varbinary Decalre @Code varchar(50) set @Code = 'A22' SELECT Currency.CurrCode, Currency.CurrName FROM CurRate INNER JOIN Currency ON CurRate.Code = Currency.CurrCode where CAST(CurRate.Code as varbinary(50)) = CAST(@Code as varbinary(50)) points to note:- @Code type & size (here varchar(50) should be same as CurRate.Code Hope this will solve your issue. Thanks

      1 Reply Last reply
      0
      • A Assaf82

        If i want to search for sentence in a whole string how i can do? Ex: str ="SELECT Currency.CurrCode, Currency.CurrName FROM CurRate INNER JOIN Currency ON CurRate.Code = Currency.CurrCode" I want to check if CurrCode exist or not ? and how to check from the case sensitive Thanks a lot

        Assaf

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

        Use the IndexOf method of the string class. There are overloads where you specify a StringComparison value that determines how the comparison is done.

        --- single minded; short sighted; long gone;

        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