Thread: String.Compare question

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    404

    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.
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amateur English)

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,214
    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, 11:43 AM
  2. String Compare
    By shruthi in forum C Programming
    Replies: 2
    Last Post: 02-09-2012, 08: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