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. Visual Basic
  4. unlimited/open string

unlimited/open string

Scheduled Pinned Locked Moved Visual Basic
helpcsharpquestionlearning
2 Posts 2 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
    Anonymous
    wrote on last edited by
    #1

    Hey, I'm a beginner with vb.net. i want to apply a chunk of code to a string only if the string has the text "B800_" in it, so i used an if statement: If sNewName = "B800_" Then blahblahblah End If My problem is, i need any string that include "B800_" not equals it, so i need it to apply to strings like "B800_this" or "B800_12345" Is there a way to make this happen? If there is a way to create an open string, or maybe something that checks if sNewName includes "B800_" then i could do something like If sNewName Includes "B800_" Then or If sNewName = "B800_" & "anything" Then Thanks for the help guys!

    K 1 Reply Last reply
    0
    • A Anonymous

      Hey, I'm a beginner with vb.net. i want to apply a chunk of code to a string only if the string has the text "B800_" in it, so i used an if statement: If sNewName = "B800_" Then blahblahblah End If My problem is, i need any string that include "B800_" not equals it, so i need it to apply to strings like "B800_this" or "B800_12345" Is there a way to make this happen? If there is a way to create an open string, or maybe something that checks if sNewName includes "B800_" then i could do something like If sNewName Includes "B800_" Then or If sNewName = "B800_" & "anything" Then Thanks for the help guys!

      K Offline
      K Offline
      KaptinKrunch
      wrote on last edited by
      #2

      I would look at the IndexOf method from the String class.

      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