Click here to Skip to main content
15,850,214 members
Home / Discussions / C#
   

C#

 
QuestionCreating and Binding UI objects in C# instead of XAML (WPF) Pin
Member 1484454026-May-20 13:04
Member 1484454026-May-20 13:04 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Mycroft Holmes26-May-20 13:26
professionalMycroft Holmes26-May-20 13:26 
AnswerRe: Creating and Binding UI objects in C# instead of XAML (WPF) Pin
Richard Deeming27-May-20 2:01
mveRichard Deeming27-May-20 2:01 
QuestionHow to mount an ISO file with disc type - CD/DVD Pin
Member 1001484126-May-20 7:43
Member 1001484126-May-20 7:43 
AnswerRe: How to mount an ISO file with disc type - CD/DVD Pin
Richard MacCutchan26-May-20 7:48
mveRichard MacCutchan26-May-20 7:48 
QuestionHow to reverse strings in other processes c# Pin
mcneb1025-May-20 12:06
mcneb1025-May-20 12:06 
AnswerRe: How to reverse strings in other processes c# Pin
Dave Kreskowiak25-May-20 19:30
mveDave Kreskowiak25-May-20 19:30 
Questionquestion about a method program Pin
Joanna Moses23-May-20 2:34
Joanna Moses23-May-20 2:34 
Hi guys trying to run a program in c# which needs to return the number of times the char occurs in string. the main is fine but the method name i created gives me an error which i don't know why.(in bold) your help will be appriciated Big Grin | :-D here is my program:

static void Main(string[] args)
{
string n = "Banana";
int num=CountOccurrences(n,'a');
Console.WriteLine(num);
        }
        static int CountOccurrences(string text, char digit)
        {
            
            for (int i=0 ; i < text.Length; i++)
            {

                if (text[i] == digit)
                {
                    i++;
                }
                return i;

            }

AnswerRe: question about a method program Pin
Richard MacCutchan23-May-20 3:00
mveRichard MacCutchan23-May-20 3:00 
AnswerRe: question about a method program Pin
OriginalGriff23-May-20 3:01
mveOriginalGriff23-May-20 3:01 
GeneralRe: question about a method program Pin
Luc Pattyn23-May-20 6:00
sitebuilderLuc Pattyn23-May-20 6:00 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 6:26
mveOriginalGriff23-May-20 6:26 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 6:52
mveRichard MacCutchan23-May-20 6:52 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 6:54
mveOriginalGriff23-May-20 6:54 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 7:08
mveRichard MacCutchan23-May-20 7:08 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 7:11
mveOriginalGriff23-May-20 7:11 
GeneralRe: question about a method program Pin
kalberts23-May-20 7:50
kalberts23-May-20 7:50 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 10:14
mveOriginalGriff23-May-20 10:14 
GeneralRe: question about a method program Pin
kalberts23-May-20 12:53
kalberts23-May-20 12:53 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 23:04
mveRichard MacCutchan23-May-20 23:04 
GeneralRe: question about a method program Pin
OriginalGriff23-May-20 23:22
mveOriginalGriff23-May-20 23:22 
GeneralRe: question about a method program Pin
Peter_in_278023-May-20 23:32
professionalPeter_in_278023-May-20 23:32 
GeneralRe: question about a method program Pin
Richard MacCutchan23-May-20 23:57
mveRichard MacCutchan23-May-20 23:57 
GeneralRe: question about a method program Pin
F-ES Sitecore24-May-20 7:48
professionalF-ES Sitecore24-May-20 7:48 
GeneralRe: question about a method program Pin
Richard MacCutchan24-May-20 7:57
mveRichard MacCutchan24-May-20 7: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.