Programming Tutorials

(追記) (追記ここまで)

pretty() in Ruby

By: Jeeva in Ruby Tutorials on 2009年03月03日 [フレーム]

pretty(string, shift = " ")

Prettify (indent) an HTML string.

string is the HTML string to indent. shift is the indentation unit to use; it defaults to two spaces.

 print CGI::pretty("<HTML><BODY></BODY></HTML>")
 # <HTML>
 # <BODY>
 # </BODY>
 # </HTML>
 print CGI::pretty("<HTML><BODY></BODY></HTML>", "\t")
 # <HTML>
 # <BODY>
 # </BODY>
 # </HTML>



(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /