Program to remove all the occurences of a given character from a String.



package com.demo; public class RemoveCharacter { public static void main(String[] args) { // input string String inputString = "Welcome to JavaTechTube"; // output after removing character System.out.println("Output after removing character : " + removeGivenCharacter(inputString, "e")); } private static String removeGivenCharacter(String inputString, String removeCharacter) { inputString = inputString.replace(removeCharacter, ""); return inputString; } }
Share:

No comments:

Post a Comment

Quote of the day

Popular Posts

Featured Post

Collection Framework Overview

Collection:- A collection (sometimes called a container) is simply an object that groups multiple elements into single unit. Collect...

Youtube Page

Facebook Page

Recent Posts

About

I am Shivaji Chandra and I'm a Computer Science Engineer. I love to write poems, jokes and quotes. click here →