AD

Code 2 record syntax

We can make a certain way the interpreter to understand our source code.

puts(%q/this is a string/) #'this is a string'
puts(%Q/this is a string/) #"this is a string"
puts(%/this is a string/)  #"this is a string"
puts(%/this (is a) string/)  #"this (is a) string"
puts(%w/this is a string/)  #["this" "is" "a" "string"], Must be separated by spaces 
puts(%W/this is a string/)  #["this" "is" "a" "string"], Must be separated by spaces 
puts(%x(echo this is a string)) #"this is string"

=begin
 Any non-letter symbols can be divided ,[],(),{},<> Is paired, other separator is the same as before and after .
=end
标签: lt, source code, interpreter, record syntax
分类: Ruby
时间: 2010-12-09

相关文章

  1. 1 record syntax to write the code format

    END{ puts("end1") } END{ puts("end2") } puts "text" # New line characters from t ...
  2. Flex error code written record

    1. Picture does not support bmp format. 2. The introduction of components in the main program when the followi ...
  3. Flex basic syntax code (1)

    Here is some code flex based syntax, check in time would be convenient to forget: package { import flash.displ ...
  4. Collate and CSS code optimization principle 7

    This article The original English text of As a web designer (Front-end Engineer), you may recall that once the ...
  5. How to use the Java 5 Annotation (Notes) to simplify the Hibernate code

    Note how to use Java 5 to simplify the Hibernate code, persistence layer and the coding process easier. Tradit ...
  6. clean code reading and thinking 2 summary

    3. Note Do not add notes on the bad code, but try to reconstruct it. Code is the latest, but notes may not be ...
  7. clean code reading and thinking summary 2

    3. Note Do not add notes on the bad code, but try to reconstruct it. Code is the latest, but notes may not be ...
  8. thinkphp verification code can not display the strange solution

    Today in the project thinkphp verification code can not be displayed, then the forum search, most problems or ...
  9. There is no such code tracker

    There is no such code tracker Is there such a program, for example, I click a button, the final emergence of a ...
  10. Mysql stored procedures first test, record what

    Today the first trial mysql stored procedure, and eventually found not suitable for my needs, stored procedure ...
  11. Chapter 4 – Code and Data Segments

    4.1 Introduction to Segments 4.2 Scope and Purpose 4.3 Segment Directive 4.4 Code Segment - TEXT 4.5 Initializ ...
  12. JAVA popular open source database

    Jakarta common: Commons Logging Jakarta Commons Logging (JCL) to provide a log of (Log) interface (interface), ...
  13. Java Virtual Machine

    As a location on the network to use the language, Java has many suitable for heterogeneous platform environmen ...
  14. <Learn You a Haskell for Great Good!> study notes (c)

    This is a summary of Chapter 7,8,9; I actually finished reading the chapter 3, spent quite a long time, the on ...
  15. And N times better than they are in charge of trouble, is to contradict themselves ah!

    Companies these days are busy with new products soon to be released, this does not have a client requests give ...
  16. Memory structure-SGA

    Oracle's memory structure consists of SGA system global area, PGA program global area and the software code ar ...
  17. Print multiple documents on the log4j Tips

    The advantages of log4j: 1. By modifying the configuration file, you can determine where to log the informatio ...
  18. Rails morgue ---- (personal notes, non-hatred you're the one)

    1.puts, print, and p (1) puts if the string is not to wrap the end, puts it out of the string to add a line br ...
  19. Oracle_SQL Small Collection (Doc)

    SQL statement definition: SQL language is the core of the database language. Full name is "structured que ...