Single-character output : STDOUT « Language Basics « Ruby
- Ruby
- Language Basics
- STDOUT
Single-character output
o = STDOUT
o.putc(65) # Write single byte 65 (capital A)
o.putc("B") # Write single byte 66 (capital B)
o.putc("CD") # Write just the first byte of the string
Related examples in the same category