Java Replacing & Removing Characters in Strings

preview_player
Показать описание
This video will show you how to remove specified characters, alphabetic letter, numeric values and sub-strings from a string. In this video you will learn to either remove or replace the specified value.
Рекомендации по теме
Комментарии
Автор

Assuming you want to remove all symbols(I guess thats what you would call it) I would use the ^ with the tools in this video to remove all of them

x = x.replaceAll("[^a-zA-Z0-9]", "");

Basically this is not touching letters or numbers.

If you want to just remove one symbol say just the # sign do this

x = x.replaceAll("#", "");

Of course if you have several replaces needed I would create a method to work through the string to clean it up.

I hope this helps

David Couch

splatbasset
Автор

THANK YOU! I was seriously confused and you cleared everything up very well!

XxStealthIsKeyxX
Автор

Thank you so much. Other video's are so unhelpful but this one saved my life.

dariusradiusbecker
Автор

thanks my teacher just skimmed through this and made us do a time assignment at the end of class.

ButterySkater
Автор

Thanks for the video, it really helped me with something I was trying to work out.

NovaBushido
Автор

What if i only want to get the curly braces and store it in a string array

abdullahazeez
Автор

Hi David ...some places i am getting number followed by only right paranthesis eg: 145) but i Want only number from the above string how should i do that

swagatikarath
Автор

Thank you so much your video was to the point and nicely explained....i liked it! GREAT JOB.

raj.rajput
Автор

ty bro, not to long but not too short. Great vid

sylito
Автор

Can this be used to remove, say, Japanese text from a dumped videogame and replace it with English characters? Intended to replace the kanji menu to an English one.

hdrgb
Автор

Thanks for the vid man, one question though. How would I make it so characters such as # and @ are omitted. I understand a-zA-z for letters and 0-9 for numbers, so is there one for all the other characters?

travisleggett
Автор

How can I do this with the user input?

cesarraynor
Автор

can we do something similar inside a printWriter?

renbll
Автор

Thank you so much, sir! I really needed this.

MDSiam-fjnb
Автор

This video works best if you choose 720p and reload so that the text will be clear.

splatbasset
Автор

thanks really easier than others thanks a lot. make more videos please and help us.

jahangirkabir
Автор

is it possible to remove or replace ' in string

chaitanayachowdary
Автор

How do you write a string and replacec it with a different character example a-e will be diff chars like a = !, b = @ ..ect?

Nyhmii
Автор

Nice tutorial !Thanks a lot this was very helpful for me

chandrakumarn
Автор

What if you wanted to remove a character but but have a group of them. e.g
5*4*3*2*1* =
How would I remove the "*" after the number 1?

FatScotishguy