Skip to main content

Posts

Showing posts with the label Coding Challenge

Coding Challenge : C# Console Application, Given a string S, shift each character to its immediate right character (note: preserve the cases)

Coding Challenge : C# Console Application, Given a string S, shift each character to its immediate right character (note: preserve the cases)   This program is a modification from this program     //   Given a string S, shift each character to its immediate right character (note: preserve the cases)     //   Sample input : HeLlo     //   Sample output : IfMmp     class Program     {         static void Main( string [] args)         {             string result = string .Empty;             Console .WriteLine( "Enter the string" );             string givenString = Console .ReadLine();             if (givenString.Trim() == string .Empty)             {                 Console .WriteLine( "Enter Correct string, Exiting application..." );             }              else             {                 char [] charArray = givenString.ToCharArray();                   foreach ( char singleChar in charArray)                 {  

Coding Challenge - ASP.NET Program : Count number of occurrences in a given string with additional criteria - StringComparison.InvariantCultureIgnoreCase

 Write a ASP.NET with C# program to achieve the following Given a sentence, count each word for number of occurrences (Main Criteria: No repetition) Additional Criteria  Case should be ignored Comma should not be counted An extra space more than single space should be ignored CountWord.aspx.cs < div >             < table >                 < tr >                     < td > Enter the string                     </ td >                     < td >                         < asp : TextBox ID ="txtInputString" Width ="500px" runat ="server">                         </ asp : TextBox >                     </ td >                     < td >                         < asp : Button ID ="btnShowResult" runat ="server" OnClick ="btnShowResult_Click" Text ="Click for result" />                     </ td >