Sha256: 619dd439a1529c8fbfd4301dff0e4da2602eb28bb7135d216c919792f56036e0
Contents?: true
Size: 576 Bytes
Versions: 9
Compression:
Stored size: 576 Bytes
Contents
module ToPass::Converters class Swapcase class << self # alternate case of letter (not numbers) def swapcase(string) pwd = "" last_upcase = true string.each_char do |char| char = if char.between?("0", "9") char elsif last_upcase last_upcase = false char.downcase else last_upcase = true char.upcase end pwd << char end pwd end end end end
Version data entries
9 entries across 9 versions & 1 rubygems