I have this simple method that goes:
private String toJsonFormat(String name, Object value, boolean first) {
value = value == null ? "" : value;
return String.format((first ? "" : ",") + "\"%1s\":\"%2s\"", name, value);
}
When my value argument is null, 2 blank spaces are added after the colon, instead of an empty string.
An example return value when null is passed:
"housenumber":" "
How come?
firstpart is really required to demonstrate the issue, you should remove that part of it. An ideal question for a problem like this contains a short but complete program with nothing but the issue at hand, along with a description of the expected and actual results.