Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
GeneralBind a window to the side of the screen Pin
heelios30-Jul-03 6:15
heelios30-Jul-03 6:15 
GeneralRe: Bind a window to the side of the screen Pin
Kastro30-Jul-03 7:57
Kastro30-Jul-03 7:57 
GeneralNeed help using IndexOf() Pin
Rbledwards30-Jul-03 6:02
Rbledwards30-Jul-03 6:02 
GeneralRe: Need help using IndexOf() Pin
leppie30-Jul-03 7:22
leppie30-Jul-03 7:22 
GeneralRe: Need help using IndexOf() Pin
Rbledwards30-Jul-03 7:50
Rbledwards30-Jul-03 7:50 
GeneralRe: Need help using IndexOf() Pin
Ista30-Jul-03 10:55
Ista30-Jul-03 10:55 
GeneralRe: Need help using IndexOf() Pin
Rbledwards30-Jul-03 14:14
Rbledwards30-Jul-03 14:14 
GeneralRe: Need help using IndexOf() Pin
Julian Bucknall [MSFT]30-Jul-03 14:16
Julian Bucknall [MSFT]30-Jul-03 14:16 
I think what you're asking is to see if a particular string is in an array of strings. Use this:

public bool ExistsInArray(string s, string[] sList) 
{
  foreach (string item in sList) 
    {
      if (item == s) return true;
    }
  return false;
}


In other words, check all strings in the list to see if the one I want is there. If it is, exit immediately I find it, returning true. If I fall through the loop, having checked all strings in the list, return false.

Cheers, Julian
Program Manager, C#

This posting is provided "AS IS" with no warranties, and confers no rights.
GeneralRe: Need help using IndexOf() Pin
Ista30-Jul-03 14:38
Ista30-Jul-03 14:38 
GeneralRe: Need help using IndexOf() Pin
Julian Bucknall [MSFT]1-Aug-03 13:54
Julian Bucknall [MSFT]1-Aug-03 13:54 
GeneralRe: Need help using IndexOf() Pin
Ista1-Aug-03 16:44
Ista1-Aug-03 16:44 
GeneralCounting New Lines in a String Pin
draco_iii30-Jul-03 5:48
draco_iii30-Jul-03 5:48 
GeneralRe: Counting New Lines in a String Pin
Nathan Blomquist30-Jul-03 6:19
Nathan Blomquist30-Jul-03 6:19 
GeneralRe: Counting New Lines in a String Pin
draco_iii30-Jul-03 6:28
draco_iii30-Jul-03 6:28 
GeneralRe: Counting New Lines in a String Pin
Nathan Blomquist30-Jul-03 6:47
Nathan Blomquist30-Jul-03 6:47 
GeneralRe: Counting New Lines in a String Pin
leppie30-Jul-03 7:13
leppie30-Jul-03 7:13 
GeneralRe: Counting New Lines in a String Pin
Julian Bucknall [MSFT]30-Jul-03 14:19
Julian Bucknall [MSFT]30-Jul-03 14:19 
GeneralRe: Counting New Lines in a String Pin
Csharp™30-Jul-03 14:38
Csharp™30-Jul-03 14:38 
GeneralRe: Counting New Lines in a String Pin
GISnet1-Aug-03 2:50
GISnet1-Aug-03 2:50 
GeneralRe: Counting New Lines in a String Pin
Julian Bucknall [MSFT]1-Aug-03 13:57
Julian Bucknall [MSFT]1-Aug-03 13:57 
GeneralFishy += opperator Pin
eggie529-Jul-03 21:38
eggie529-Jul-03 21:38 
GeneralRe: Fishy += opperator Pin
Alexander Kojevnikov29-Jul-03 21:52
Alexander Kojevnikov29-Jul-03 21:52 
GeneralRe: Fishy += opperator Pin
eggie530-Jul-03 12:34
eggie530-Jul-03 12:34 
GeneralRe: Fishy += opperator Pin
Csharp™30-Jul-03 13:16
Csharp™30-Jul-03 13:16 
GeneralRe: Fishy += opperator Pin
Csharp™30-Jul-03 13:18
Csharp™30-Jul-03 13:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.