SyntaxFix
Write A Post
Hire A Developer
Questions
You can try something like this:
StringBuilder sb = new StringBuilder(); if (condition) { sb.append("elementName").append(","); } if (anotherCondition) { sb.append("anotherElementName").append(","); } String parameterString = sb.toString();