Click here to Skip to main content
15,898,588 members
Home / Discussions / C#
   

C#

 
AnswerRe: how do I change a regex Pin
OriginalGriff2-Feb-15 21:18
mveOriginalGriff2-Feb-15 21:18 
GeneralRe: how do I change a regex Pin
Member 113543863-Feb-15 14:03
Member 113543863-Feb-15 14:03 
GeneralRe: how do I change a regex Pin
OriginalGriff3-Feb-15 23:28
mveOriginalGriff3-Feb-15 23:28 
Questionwindows 8 hybrid shutdown notification Pin
morglorf2-Feb-15 11:33
morglorf2-Feb-15 11:33 
AnswerRe: windows 8 hybrid shutdown notification Pin
Richard Andrew x642-Feb-15 11:53
professionalRichard Andrew x642-Feb-15 11:53 
GeneralRe: windows 8 hybrid shutdown notification Pin
morglorf2-Feb-15 12:17
morglorf2-Feb-15 12:17 
GeneralRe: windows 8 hybrid shutdown notification Pin
morglorf3-Feb-15 5:54
morglorf3-Feb-15 5:54 
QuestionHelp with Array search. Pin
Member 114193361-Feb-15 18:18
Member 114193361-Feb-15 18:18 
Hello there,
I'm new in C# language (Actually in programming) , and i try to made an array , and i make search commands to show if the name exist or no .

It works fine , but i need to show me the names that start with the letters i used only .
for example , i used name "Omar" , if i type "m" in the search , it says that "m" letter has been found in the list , but it won't show me the name , because there is no name in the array starts with "m" , and the m they found belong to "Omar" .

so here's my code ,
C#
public static void Main()
{
    string[] names = { "Omar", "-232" , "Don" , "Test"};
    string theSelected = string.Join(" " , names);

    Console.WriteLine("The Avilable names are : " + theSelected);
    Console.WriteLine("Which name you need ? ");
point: string Selected = Console.ReadLine();
    string[] first = Array.FindAll(names, namess => namess.ToLower().StartsWith(Selected.ToLower(), StringComparison.Ordinal));
    int i = 4;
   if (!(Selected == "") && !(Selected.StartsWith(" ")))
    {
        if (theSelected.ToLower().Contains(Selected.ToLower()))
        {
            Console.WriteLine("The names start with " + Selected.ToUpper() + " is / are : \n" + string.Join("\n", first));
        }
        else
        {
            Console.WriteLine("The names start with " + Selected + " is / are : \nNone");

        }
    }
    else
    {
        Console.WriteLine("The Avilable names are : " + theSelected);
        goto point;
    }
    Console.ReadKey();
}

AnswerRe: Help with Array search. Pin
Richard Andrew x641-Feb-15 18:34
professionalRichard Andrew x641-Feb-15 18:34 
GeneralRe: Help with Array search. Pin
Member 114193361-Feb-15 19:28
Member 114193361-Feb-15 19:28 
AnswerRe: Help with Array search. Pin
BillWoodruff1-Feb-15 21:16
professionalBillWoodruff1-Feb-15 21:16 
AnswerRe: Help with Array search. Pin
Richard Deeming2-Feb-15 2:53
mveRichard Deeming2-Feb-15 2:53 
AnswerRe: Help with Array search. Pin
ramazan aktolu3-Feb-15 7:36
ramazan aktolu3-Feb-15 7:36 
QuestionTrouble binding with TCP to same local endpoint Pin
Mc_Topaz1-Feb-15 4:07
Mc_Topaz1-Feb-15 4:07 
AnswerRe: Trouble binding with TCP to same local endpoint Pin
Richard MacCutchan1-Feb-15 5:22
mveRichard MacCutchan1-Feb-15 5:22 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Mc_Topaz1-Feb-15 5:27
Mc_Topaz1-Feb-15 5:27 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Richard MacCutchan1-Feb-15 6:05
mveRichard MacCutchan1-Feb-15 6:05 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Mc_Topaz1-Feb-15 6:43
Mc_Topaz1-Feb-15 6:43 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
OriginalGriff1-Feb-15 7:43
mveOriginalGriff1-Feb-15 7:43 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
OriginalGriff1-Feb-15 5:38
mveOriginalGriff1-Feb-15 5:38 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Richard MacCutchan1-Feb-15 6:05
mveRichard MacCutchan1-Feb-15 6:05 
NewsRe: Trouble binding with TCP to same local endpoint Pin
Mc_Topaz1-Feb-15 6:39
Mc_Topaz1-Feb-15 6:39 
AnswerRe: Trouble binding with TCP to same local endpoint Pin
Pete O'Hanlon2-Feb-15 6:31
mvePete O'Hanlon2-Feb-15 6:31 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Mc_Topaz2-Feb-15 19:57
Mc_Topaz2-Feb-15 19:57 
GeneralRe: Trouble binding with TCP to same local endpoint Pin
Pete O'Hanlon2-Feb-15 23:18
mvePete O'Hanlon2-Feb-15 23: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.