Created
February 12, 2015 09:45
-
-
Save wagurano/2980abd1d8ef778f67b4 to your computer and use it in GitHub Desktop.
가게이름 일부 가리는 방법
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name = [ | |
"상회", | |
"분당상가", | |
"백화점", | |
"NC백화점" | |
] | |
print "name = " | |
p name | |
name.each do |n| | |
printf "%.3s***\n", n | |
end | |
list = [ | |
"아리랑상사", | |
"우리온세상약국", | |
"하" | |
] | |
print "list = " | |
p list | |
list.each do |l| | |
printf "'%#-4s'\n", l | |
ll = sprintf "%#-4s", l | |
printf "%.#{ll.length-3}s***\n", ll | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment