Thread: String.Compare question

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    String.Compare question

    Hi!

    Code:
    i = String.Compare(strActor, 0, comboBoxFilterActors.Text, 0, comboBoxFilterActors.Text.Length, true);
    strActor contains a bunch of actor names (e.g. "Franka Potente, Tom Tykwer, Moritz Bleibtreu,"). comboBoxFilterActors.Text contains a single actor name to search through strActor. Now because i've input comboBoxFilterActors.Text.Length as the 6th parameter, the compare method searches only through comboBoxFilterActors.Text variable length in strActor. But i wanna search through whole strActor. How to do that?

    Thanks a lot.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    I think you should be using String.Contains() instead.
    If you understand what you're doing, you're not learning anything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. string compare
    By ingeniousreader in forum C Programming
    Replies: 7
    Last Post: 03-02-2012, 12:43 PM
  2. String Compare
    By shruthi in forum C Programming
    Replies: 2
    Last Post: 02-09-2012, 09:27 AM
  3. Unable to compare string with 'getter' returned string.
    By Swerve in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2009, 05:56 PM
  4. Compare 2 String
    By nitediver in forum C Programming
    Replies: 2
    Last Post: 10-06-2009, 07:48 AM
  5. string compare
    By IceBall in forum C Programming
    Replies: 4
    Last Post: 10-12-2003, 05:26 PM