Techno Blender
Digitally Yours.
Browsing Tag

Coding Contests

Extracting all present dates in any given String using Regular Expressions

import java.io.*; import java.util.regex.Matcher; import java.util.regex.Pattern;    public class GFG {             public static void main(String args)     {                     String str             = "The First Version was released on 12-07-2008."               + "Next Release will might come on 12 July 2009. "               + "The due date for paymnet is  2023-09-1."               + "India gained its freedom on 15 August 1947 which was a Friday."               + "Republic Day is a public holiday in India…

What are Discriminated union types?

In TypeScript, a discriminated union type is also called “tagged union types” or “algebraic data types”. It is a type that represents a value that can be one of several different types, with a tag indicating the type of the value. To create a discriminated union type in TypeScript, use the ‘|’ operator to combine the set of types. Here, the “discriminant” property can be used to distinguish between the different shapes of the object.  A discriminated union…