Like Tree1Likes
  • 1 Post By itsme86

String.Compare question

This is a discussion on String.Compare question within the C# Programming forums, part of the General Programming Boards category; Hi! Code: i = String.Compare(strActor, 0, comboBoxFilterActors.Text, 0, comboBoxFilterActors.Text.Length, true); strActor contains a bunch of actor names (e.g. " Franka ...

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

    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.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,164
    I think you should be using String.Contains() instead.
    geek@02 likes this.
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21