Formatting the first symbol of a string to be upper case - a private method or formatting on the go? [closed]

2 weeks ago 14
ARTICLE AD BOX

In a class that has a bunch of functions, should I be making a separate private method specifically for formatting or should I just be formatting in every function that requires a string to be formatted?

Method for formatting:

private String formatItemName(String item) { item = item.toLowerCase(); // make all letters lowercase return item.substring(0, 1).toUpperCase() // capitalize first letter + item.substring(1); // add the rest }
Read Entire Article