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 contained within string

String contained within string

Scheduled Pinned Locked Moved C#
4 Posts 4 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
    kanchoette
    wrote on last edited by
    #1

    I have a test if (element.Value.ToString().ToLower() == "home owner") { summaryHomeOwnerTextBox.Text = "Yes"; } How can I test to see with the string "home owner" is contained within element.Value.ToString().ToLower() please?

    L R 2 Replies Last reply
    0
    • K kanchoette

      I have a test if (element.Value.ToString().ToLower() == "home owner") { summaryHomeOwnerTextBox.Text = "Yes"; } How can I test to see with the string "home owner" is contained within element.Value.ToString().ToLower() please?

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

      too lazy to read up on String class? :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


      M 1 Reply Last reply
      0
      • K kanchoette

        I have a test if (element.Value.ToString().ToLower() == "home owner") { summaryHomeOwnerTextBox.Text = "Yes"; } How can I test to see with the string "home owner" is contained within element.Value.ToString().ToLower() please?

        R Offline
        R Offline
        ricmil42
        wrote on last edited by
        #3

        kanchoette wrote:

        if (element.Value.ToString().ToLower() == "home owner")

        if (element.Value.ToString().ToLower().Contains ( "home owner") )

        1 Reply Last reply
        0
        • L Luc Pattyn

          too lazy to read up on String class? :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


          M Offline
          M Offline
          musefan
          wrote on last edited by
          #4

          or even use the Intelisense of an IDE, there all pretty self explainitory methods and functions lol but hey, as im sure you know already, there are alot of people on these forums that just are'nt cut out for this kind of 'hard' work :laugh:

          Life goes very fast. Tomorrow, today is already yesterday.

          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