First X vowels from a string
Given a string str and an integer X, the task is to find and print the first X vowels from str. If the total vowels in str is < X then print -1....
read more
Different ways to copy a string in C/C++
Copying a string is a common operation in C/C++ used to create a duplicate copy of the original string. In this article, we will see how to copy strings in C/C++....
read more
How to check if string contains only digits in Java
Given string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then print true, otherwise false....
read more
Check if an URL is valid or not using Regular Expression
Given a URL as a character string str of size N.The task is to check if the given URL is valid or not.Examples :...
read more
Generate random String of given size in Java
Given a size as n, The task is to generate a random alphanumeric String of this size. Below are various ways to generate random alphanumeric String of given size: Prerequisite : Generating random numbers in Java...
read more
Why Java Strings are Immutable?
Before proceeding further with the fuss of immutability, let’s just take a look into the String class and its functionality a little before coming to any conclusion. In this article, we will learn about the fact why Java Strings are Immutable....
read more
Prefix to Infix Conversion
Infix : An expression is called the Infix expression if the operator appears in between the operands in the expression. Simply of the form (operand1 operator operand2). Example : (A+B) * (C-D)...
read more
Reverse individual words
Given string str, we need to print the reverse of individual words....
read more
Frequency of a Substring in a String
Given an input string and a pattern, the task is to find the frequency of occurrences of the string pattern in a given string....
read more
Remove All Duplicates from a Given String in Python
We are given a string and we need to remove all duplicates from it. What will be the output if the order of character matters? Examples:...
read more
Check whether K-th bit is set or not
Given a number N and a bit number K, check if the Kth bit of N is set or not. A bit is called set if it is 1. Note: Indexing starts with 0 from LSB (least significant bit) side in the binary representation of the number....
read more
Sum of two large numbers
Given two numbers as strings. The numbers may be very large (may not fit in long long int), the task is to find sum of these two numbers....
read more