Category: String

How much memory does a string consume in Java 0

How much memory does a string consume in Java

Understanding String memory usage To understand the above calculation, we need to start by looking at the fields on a String object. A String contains the following: a char array— thus a separate object—...

How to split string which has dollars($) 0

How to split string which has dollars($)

Suppose we have a string data1$$$data2$$$data3, how will you split it? If you use str.split(“$$$”) it will not split the string and instead return the same string only. The split function takes a regular...