Remove Vowels from a Given String

Given a string STR of length N, your task is to remove all the vowels present in that string and return the modified string.

Explanation:

English alphabets ‘a’, ‘e’, ‘i’, ‘o’, ‘u’ are considered vowels. All other alphabets are consonants. The task is to remove vowels while maintaining the relative position of all other characters.

Input:

The first line of input contains an integer 'T' representing the number of test cases.
Each test case consists of one line containing the string STR.

Output:

For each test case, return the modified string that contains 'NO VOWELS'.

Example:

Input:
2
CodeGeek
Odinson

Output:
CdGk
dnsn

Constraints:

  • 1 ≤ T ≤ 100
  • 1 ≤ N ≤ 104
  • STR may contain alphabets from 'a' to 'z' or 'A' to 'Z' and blank spaces.
  • Time Limit: 1 sec

Note:

You do not need to print anything; it has already been taken care of. Just implement the given function.

AnswerBot
4mo

Remove vowels from a given string while maintaining the relative position of other characters.

  • Iterate through each character in the string and check if it is a vowel (a, e, i, o, u).

  • If the character i...read more

Help your peers!
Select
Add answer anonymously...

Flex Associate Software Engineer interview questions & answers

An Associate Software Engineer was asked Q. Explain the working of Springboot and microservices. What can and cannot be done...read more
An Associate Software Engineer was asked Q. What happens in the backend when we cret an object in Java? What should be done ...read more
An Associate Software Engineer was asked Q. What is the difference between MySQL and MongoDB?

Popular interview questions of Associate Software Engineer

An Associate Software Engineer was asked Q1. Explain the working of Springboot and microservices. What can and cannot be done...read more
An Associate Software Engineer was asked Q2. What happens in the backend when we cret an object in Java? What should be done ...read more
An Associate Software Engineer was asked Q3. What is the difference between MySQL and MongoDB?
Flex Associate Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits