Following program finds a substring in a string. public static int Find(string text, string pattern) { // ASHI COMPARE A,S,H,I // SHI A==S,S==H for (int i = 0; i <=text.Length - pattern.Length; i++) { int temp = i; for (int j = 0; j < … [Continue reading] about Finding substring in a string
Program to check valid parenthesis
Program to check valid parenthesis public class Solution { public bool IsValid(string s) { Stack stack=new Stack(); foreach(char ch in s) { if(ch=='(' || ch=='{' || ch=='[') stack.Push(ch); if(ch==')' || ch=='}' || … [Continue reading] about Program to check valid parenthesis
Angular CLI tutorial
Angular cli is a useful toolset which helps in development,testing and deployment of Angular applications. Check if cli is installed ng --version Install latest version of angular cli npm install -g @angular/cli@latest Create new Angular project … [Continue reading] about Angular CLI tutorial
Delegates in C#
There are different types in C# such as class,interfaces and enums.One of the reference type is delegate.Delegate allows to define objects which can point to a function.This makes it convenient to define decoupled application and pass function as a … [Continue reading] about Delegates in C#
Router Guard in Angular
Route Guards determine whether to allow or deny navigation within Angular application. There are 4 types of routing guards in Angular: CanActivate Determines if a route can be activated CanActivateChild If route children can be activated … [Continue reading] about Router Guard in Angular