Author: Arpit Mandliya
- 04 May
Validate password in java
In this post, we will see how to validate a password in java. Here are rules for password: Must have at least one numeric character Must have at least one lowercase character Must have at least one uppercase character Must have at least one special symbol among @#$% Password length should be between 8 and […]
- 04 May
Java regex for currency symbols
In this post, we will see about regex to find currency symbols in a text. You can use below regex to find currency symbols in any text. \\p{Sc} Each unicharacter belongs to certain category and you can search for it using /p. Sc is short code for current symbol, so using \p{Sc}, we are trying […]
- 04 May
Python Regex for alphanumeric characters
In this post, we will see regex which can be used to check alphanumeric characters. Let’s say you want to check user’s input and it should contain only characters from a-z, A-Zor 0-9. Here is the regex to check alphanumeric characters in python. ^[a-zA-Z0-9]*$ Here is the explaination of above regex. ^ : denotes start […]
- 04 May
Python concatenate string and int
This tutorial teaches how to concatenate string and int in Python In other languages such as Java, C++, etc, you can concatenate string and int using + operator, but you can not do the same in python. How to concatenate string and int in Python Let’s first try to use + operator to concatenate string […]
- 04 May
Java credit card validation – Luhn Algorithm in java
In this post, we will see about Luhn Algorithm in java Introduction Luhn algorithm, also known as modulus 10 or mod 10 algorithm, is a simple checksum process for validating various identification numbers such as credit card numbers, Canadian social securities numbers. This algorithm is designed to protect again mistyped or accidental error rather than […]
- 26 April
Java Stream List to Map
In this post, we will see how to convert List to Map using Stream in java 8. Collectors’s toMap() can be used with stream to convert List to Map in java. Consider a class Named Movie which have 3 fields – id, name and genre [crayon-678967e34e1b5532510380/] Create a list of movies and convert with to […]
- 26 April
Java Stream sorted example
In this post, we will see how to sort a list with Stream.sorted() method. Java 8 has introduced Stream.sort() method to sort list of elements conveniently. It helps us to write short and concise functional style code rather than boilerplate code. java.util.Stream has two overloaded versions of sorted() method. sorted(): Returns a stream having elements […]
- 26 April
Python pretty print json
In this post, we will see how to pretty print JSON in Python. We can use the Python JSON module to pretty-print JSON data. We can use json’s dumps() method with indent parameter to pretty print json data. Python pretty print json string Let’s understand this with the help of example. [crayon-678967e34e72c121064678/] Output: [ { […]
- 24 April
Add character to String in java
In this post, we will see how to add character to String in java. There are multiple ways to add character to String. Add character to the start of String You can add character at start of String using + operator. [crayon-678967e34e804421158904/] Add character to the end of String You can add character at start […]