In OOP such as C# and Java if I were to create a class to do all string manipulation, I know it is better to make all the function static. However when I need to call those functions multiple times, which one will be a better option (in the context of using less resources):
Creating an object one time only and call the function using that object.
StringManipulation sm = new StringManipulation(); sm.reverse("something"); sm.addPadding("something"); sm.addPeriod("something");
or
Calling the class directly everytime
StringManipulation.reverse("something"); StringManipulation.addPadding("something"); StringManipulation.addPeriod("something");