胡争辉

胡争辉

Module#attr_reader

require "PP"class MyClass attr_reader :scheduleendMyObject = MyClass.newPP::pp MyObject.schedule # nillMyObject.schedule = 0 # undefined m...

2007-07-30 04:12:00

阅读数 830

评论数 0

Array#join

require "PP"PP::pp ["line1", "line2"].join("/n") # "line1/nline2" 

2007-07-29 10:07:00

阅读数 797

评论数 0

String#center

require "PP"PP::pp "hello".center(4) # "hello"PP::pp "hello".center(20) # " hello ...

2007-07-29 09:28:00

阅读数 812

评论数 0

Object#respond_to?

require "PP"PP::pp Array.new.respond_to?("class") # truePP::pp Array.new.respond_to?("new") # false

2007-07-28 21:30:00

阅读数 806

评论数 0

Object#class

require "PP"PP::pp Array.new.class # Array 

2007-07-28 21:25:00

阅读数 790

评论数 0

Array::new

require "PP"PP::pp Array.new # [] 

2007-07-28 17:39:00

阅读数 696

评论数 0

$'

require "PP"/(/w+), (/w+), or (/w+)/ =~ Without a Bob, ox, or bin!PP::pp $ ` # "Without a "

2007-07-28 17:11:00

阅读数 684

评论数 0

$`

require "PP"/(/w+), (/w+), or (/w+)/ =~ Without a Bob, ox, or bin!PP::pp $ ` # "Without a "

2007-07-28 17:01:00

阅读数 667

评论数 0

$&

require "PP"/(/w+), (/w+), or (/w+)/ =~ Without a Bob, ox, or bin!PP::pp $ & # "Bob, ox, or bin"

2007-07-28 16:53:00

阅读数 712

评论数 0

String#[regexp]

require "PP"PP::pp "has 5 and 3" [//d+/] # "5" 

2007-07-28 16:31:00

阅读数 778

评论数 0

MatchData#post_match

require "PP"re = /(/w+), (/w+), or (/w+)/s = Without a Bob, ox, or bin!match = re.match(s)PP::pp match.post_match # "!" 

2007-07-28 16:20:00

阅读数 779

评论数 0

MatchData#pre_match

require "PP"re = /(/w+), (/w+), or (/w+)/s = Without a Bob, ox, or bin!match = re.match(s)PP::pp match.pre_match #"Without a " 

2007-07-28 16:16:00

阅读数 774

评论数 0

Array#sort

require "PP"PP::pp [3, 1, 2].sort #[1, 2, 3] 

2007-07-27 22:44:00

阅读数 715

评论数 0

regexp#match

require "PP"PP::pp /a/.match(this is a string) # # 

2007-07-27 17:48:00

阅读数 844

评论数 0

String#include?

require "PP"PP::pp "hello".include?("lo") # truePP::pp "hello".include?("ol") # falsePP::pp "h...

2007-07-09 13:48:00

阅读数 849

评论数 0

Enumerable#find_all

require "PP"PP::pp((1..10).find_all {|i| i % 3 == 0}) # [3, 6, 9] 

2007-07-09 13:39:00

阅读数 727

评论数 0

Float#round

print (-39.30 * 100).to_i, "/n" #-3929print (-39.30 * 100.0).to_i, "/n" #-3929print (-39.30 * 100).round, "/n" #-3930pr...

2007-07-09 13:10:00

阅读数 635

评论数 0

String#rjust

require "PP"PP::pp audit.rjust(14) # " audit" 

2007-07-09 10:47:00

阅读数 745

评论数 0

Time#strftime

require "PP"PP::pp Time.now.strftime(%Y-%m-%d) #"2007-07-08" 

2007-07-08 16:40:00

阅读数 732

评论数 0

Time::local

require "PP"PP::pp Time.local(2005, 1, 1) # Sat Jan 01 00:00:00 +0800 2005PP::pp Time.local(2005, 1, 29) # Sat Jan 29 00:00:00 +0800 2005 

2007-07-08 16:12:00

阅读数 663

评论数 0

提示
确定要删除当前文章?
取消 删除