# One line to print the statement AS WELL AS the evaluated val

**URL:** <https://www.ruby-forum.com/t/one-line-to-print-the-statement-as-well-as-the-evaluated-val/196467>\
**Category:** Rails\
**Created:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/one-line-to-print-the-statement-as-well-as-the-evaluated-val/196467 "2007-09-17T13:25:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/one-line-to-print-the-statement-as-well-as-the-evaluated-val/196467/1 "2007-09-17T13:25:17Z")

</div>

i wonder in Ruby, is there a line method to do something like in C

print\_val(“Array[3] + 1”)

and get the printout of

Array[3] + 1 is 3.345
