以下の内容はhttps://tbpgr.hatenablog.com/entry/20141207/1417929410より取得しました。


Ruby | String | <<

概要

String#<< other -> self
String#concat(other) -> self

詳細

self に文字列 other を破壊的に連結。
other が 0 から 255 のまでの整数の場合はASCIIコードで対応する文字を結合する。
self を返します。

サンプルコード
require 'tbpgr_utils'

base = "base"
bulk_puts_eval binding, <<-EOS
base << "plus"
base
base.concat "plus"
base
base << 65
base
EOS

__END__
下記はTbpgrUtils gemの機能
bulk_puts_eval

https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils

出力

base << "plus"     # => "baseplus"
base               # => "baseplus"
base.concat "plus" # => "baseplusplus"
base               # => "baseplusplus"
base << 65         # => "baseplusplusA"
base               # => "baseplusplusA"



以上の内容はhttps://tbpgr.hatenablog.com/entry/20141207/1417929410より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14