如何在Java Character类中表示空字符 [英] How to represent empty char in Java Character class
本文介绍了如何在Java Character类中表示空字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Java中将空字符表示为String中的""
...
I want to represent an empty character in Java as ""
in String...
像char ch = an empty character;
实际上,我想替换字符而不留空格.
Actually I want to replace a character without leaving space.
我认为了解这意味着什么可能就足够了:没有字符甚至没有空格.
I think it might be sufficient to understand what this means: no character not even space.
推荐答案
您可以分配'\u0000'
(或0).
为此,请使用 Character.MIN_VALUE
.
You may assign '\u0000'
(or 0).
For this purpose, use Character.MIN_VALUE
.
Character ch = Character.MIN_VALUE;
这篇关于如何在Java Character类中表示空字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文