Click here to Skip to main content
15,915,703 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Ertuğrul ÇİÇEK28-May-20 6:32
Ertuğrul ÇİÇEK28-May-20 6:32 
GeneralRe: C# How To Get Version Info Of exe in FTP Pin
Richard Deeming28-May-20 8:32
mveRichard Deeming28-May-20 8:32 
QuestionCreating and Binding UI objects in C# instead of XAML (WPF) Pin
Member 1484454026-May-20 12:04
Member 1484454026-May-20 12:04 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Mycroft Holmes26-May-20 12:26
professionalMycroft Holmes26-May-20 12:26 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Richard Deeming27-May-20 1:01
mveRichard Deeming27-May-20 1:01 
QuestionHow to mount an ISO file with disc type - CD/DVD Pin
Member 1001484126-May-20 6:43
Member 1001484126-May-20 6:43 
AnswerRe: How to mount an ISO file with disc type - CD/DVD Pin
Richard MacCutchan26-May-20 6:48
mveRichard MacCutchan26-May-20 6:48 
QuestionHow to reverse strings in other processes c# Pin
mcneb1025-May-20 11:06
mcneb1025-May-20 11:06 
AnswerRe: How to reverse strings in other processes c# Pin
Dave Kreskowiak25-May-20 18:30
mveDave Kreskowiak25-May-20 18:30 
Questionquestion about a method program Pin
Joanna Moses23-May-20 1:34
Joanna Moses23-May-20 1:34 
AnswerRe: question about a method program Pin
Richard MacCutchan23-May-20 2:00
mveRichard MacCutchan23-May-20 2:00 
Your CountOccurrences method has its return statement in the wrong place. Also you are incrementing the loop count in two places so your result will most likely be wrong. It should be:
C#
static int CountOccurrences(string text, char digit)

    int count = 0; // use a separate counter for the number of matches
    
    for (int i=0 ; i < text.Length; i++)
    {
        if (text[i] == digit)
        {
            count++;
        }
    }
    return count;
}

AnswerRe: question about a method program Pin
OriginalGriff23-May-20 2:01
mveOriginalGriff23-May-20 2:01 
GeneralRe: question about a method program Pin
Luc Pattyn23-May-20 5:00
sitebuilderLuc Pattyn23-May-20 5:00 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 5:26
mveOriginalGriff23-May-20 5:26 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 5:52
mveRichard MacCutchan23-May-20 5:52 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 5:54
mveOriginalGriff23-May-20 5:54 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 6:08
mveRichard MacCutchan23-May-20 6:08 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 6:11
mveOriginalGriff23-May-20 6:11 
GeneralRe: question about a method program Pin
kalberts23-May-20 6:50
kalberts23-May-20 6:50 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 9:14
mveOriginalGriff23-May-20 9:14 
GeneralRe: question about a method program Pin
kalberts23-May-20 11:53
kalberts23-May-20 11:53 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 22:04
mveRichard MacCutchan23-May-20 22:04 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 22:22
mveOriginalGriff23-May-20 22:22 
GeneralRe: question about a method program Pin
Peter_in_278023-May-20 22:32
professionalPeter_in_278023-May-20 22:32 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 22:57
mveRichard MacCutchan23-May-20 22:57 

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.