#!/usr/bin/ruby a = "hello, world" token = a.split(/[ ,]/) token.each {|t| puts t unless t == ""}