CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Strings

  1. #1
    Join Date
    Jan 2000
    Posts
    45

    Strings

    How would I detect if any string is in text1? so then it adds the text to text2???


  2. #2
    Guest

    Re: Strings

    I'm not really sure what you're trying to acheive here.
    If you want to look for a particular string in text1 then use the instr function
    ie.

    if instr(1,text1.text,"mystring") then
    text2.text="mystring"
    end if



    if you just want to make sure that text1 contains something then do the following

    if trim(text1.text)<>"" then
    text2.text=text1.text
    end if




    hope this answers your question





  3. #3
    Join Date
    Aug 1999
    Location
    US, Florida
    Posts
    817

    Re: Strings

    here is the code to check for string in text1

    If Text1.Text <> "" then Text2 = Text2 + Text1






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured