class RuboCop::Cop::Performance::RedundantStringChars
def build_good_method(method, args)
def build_good_method(method, args) case method when :[], :slice "[#{build_call_args(args)}].chars" when :first if args.any? "[0...#{args.first.source}].chars" else '[0]' end when :last if args.any? "[-#{args.first.source}..-1].chars" else '[-1]' end when :take "[0...#{args.first.source}].chars" when :drop "[#{args.first.source}..-1].chars" else ".#{method}" end end