cut functionality done with test cases and using string builder.