for illustration wrote two methods with String and StringBuilder