Why is there no String.Empty in Java?

前端 未结 12 1378
悲哀的现实
悲哀的现实 2020-12-07 15:11

I understand that every time I type the string literal \"\", the same String object is referenced in the string pool.

But why doesn\'t the String API in

12条回答
  •  醉梦人生
    2020-12-07 15:59

    It's funny how old this is and there is still no nice string class like there is in C#. I have been doing Java for a few years now and I still also do c#. When I do Java I miss the completeness of the c# language for strings. Mainly I miss string.Empty and string.IsNullOrEmpty(string). I also really miss the lowercase string type.

    ++++1 for adding this stuff to Java. All the workarounds are just that. Happy Coding in 2020 and beyond!!

提交回复
热议问题