Posts

Showing posts with the label String Program in C#

Filters In MVC

 Authentication Filters: Authentication filter runs before any other filter or action method. Authentication confirms that you are a valid or invalid user. Authorization Filters:  Authorization Filters are responsible for checking User Access. These filters used to implement authentication and authorization for controller actions. Action Filters : Action Filter is an attribute that you can apply to a controller action or an entire controller. This filter will be called before and after the action starts executing and  after the action has executed. Result Filters: The Output Cache Attribute class is an example of Result Filters. These implement the IResult Filter interface which like the IAction Filter has OnResult Executing and OnResult Executed. These filters contain logic that is executed before and after a view result is executed.  Like if you want to modify a view result right before the view is rendered to the browser. Exception Filters :  The HandleErrorA...

String Program in C#

using System; using System.Linq; 1)Reverse Name String  in C# String Name="Sudam"; int Len=Name.Length-1; while(Len>=0) { Console.Write(Name[Len]); Len--; } ----------------------------------------- Output --madus ----------------------------------------- 2)Reverse Words of a String in C# string s = "I Name Is Sudam"; string[] a = s.Split(' '); int temp= a.Length - 1; while (temp >= 0) {     Console.Write(a[temp] + ' ');     temp--; } ------------------------------------------ Output --Sudam Is Name I ---------------------------------------- 3) How to Fine count how many double letters are in a string? int doubleLetters = 0; string characters = "Hello"; for (int i = 0; i < characters.Length - 1; i++) {     if (characters[i] == characters[i + 1])     {         doubleLetters++;         i++;     }     Console.WriteLine(doubleLetters); } -----------------------------------------...

Popular posts from this blog

Insert Data in database and bind to gridview

Api

Oracle database