How to represent empty char in Java Character class

后端 未结 16 879
遥遥无期
遥遥无期 2020-11-29 02:11

I want to represent an empty character in Java as \"\" in String...

Like that char ch = an empty character;

Actually I want to rep

16条回答
  •  独厮守ぢ
    2020-11-29 02:34

    Hey i always make methods for custom stuff that is usually not implemented in java. Here is a simple method i made for removing character from String Fast

        public static String removeChar(String str, char c){
            StringBuilder strNew=new StringBuilder(str.length());
            char charRead;
            for(int i=0;i

    For explaintion, yes there is no null character for replacing, but you can remove character like this. I know its a old question, but i am posting this answer because this code may be helpful for some persons.

提交回复
热议问题