User303363814 posted
i think is very clean
Always imagine that the maintenance programmer is an axe murder who knows where you live.
Don't reuse variable names within a method. Just don't do it. (Yes, you are allowed but think of the people coming after you trying to sort out the code/confusion).
Don't use 'str' as a variable name. Variable names should be descriptive.
If your code is repetitive (as 'Do something' and 'Repeat it' implies) then split the repetition into its own method so you don't repeat yourself. You may need a parameter, that's ok. (Time passes ... 'I need to modify that code ... I wonder how many places
I copied and pasted it slightly differently????' Programmer runs screaming into the distance!)
Remember that in six months you are a different person ... that maintenance programmer is you. Be nice to your future self.