Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

rubyÈçºÎ¸ñʽ»¯Êý×Ö£¿£¨´ÓÓÒ±ßÆðÿÈýλһ¸ö¶ººÅ¸ô¿ª£©

Êý×Ö´ÓÓÒ±ßÆðÿÈýλÓÃÒ»¸ö¶ººÅ¸ô¿ª
1232445 ⇒ 1,232,445
---- ChangeStr.rbÄÚÈÝ ------------------------------------------
def change_str(num)
  str = num.to_s
  nil while str.gsub!(/(.*\d)(\d\d\d)/, '\1,\2')
  return str
end
s = change_str(1243245)
puts s

---- 執ÐÐ -------------------------
C:\WINDOWS>ruby ChangeStr.rb
1,243,245

×Ô¼º½â決! hehe


ллtaito¡¢ÕÒµ½ÁË¡ý
http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html


Ïà¹ØÎÊ´ð£º

£¨¼±£©ruby µ÷ÓÃvcдµÄ¿âÎļþÎÊÌâ

ÎÒ×Ô¼ºÐ´ÁËÒ»¸ö¿âÎļþ£¬¿âÎļþÄÚ²¿Ã»ÎÊÌâ¡£ÎÒÏÖÔÚÏëÓà ruby£¨rpgÀµ÷ÓÃÕâ¸ö¿â£¬ÏÖÔÚÎÊÌâ³öÀ´ÁË£¬±¨´í£¬ËµµÄÊÇGetProcAddress : nSrv or nSrvA  ºÃÏñÊDz»ÄÜÕÒµ½Õâ¸öº¯Êý°É£¬ nSrv ÊÇÎÒ¿âÎļþÀïµÄÒ»¸öº¯ÊýµÄÃû× ......

Çë½Ì Ruby ´úÂë ת»»³É java´úÂë

Ruby ´úÂëÈçÏ£º
class Array
  def uniq_by
seen = {}
select{ |x|
  v = yield(x)
  !seen[v] && (seen[v]=true)
}
  end
end

Çója ......

[ÒÑÊÜÀí] ¸øJavascriptºÍRuby¿ª¸öÂÛ̳רÀ¸°É!

¸øJavascriptºÍRuby¿ª¸öÂÛ̳רÀ¸°É!
¸øJavascriptºÍRuby¿ª¸öÂÛ̳רÀ¸°É!
¸øJavascriptºÍRuby¿ª¸öÂÛ̳רÀ¸°É!
JavascriptÓÐרÀ¸µÄ£ºhttp://forum.csdn.net/SList/JavaScript

×ð¾´µÄÓû§deping_chen£¬ÄúºÃ£º ......

ÏëÕÒÒ»·ÝRuby on railsµÄ¹¤×÷,ÎÒÓ¦¸ÃÖªµÀÄÄЩ֪ʶ?

ÐÂÄê¸Õ¿ªÊ¼,ÒѾ­ÓÐһЩÉúÃ͵ÄÅóÓÑÒª¿ªÊ¼ÐµÄÖ°³¡ÉúÑÄÁË,
²»ÖªµÀ»á²»»áÓöµ½ÕâÑùµÄÎÊÌâ: ÏëÕÒÒ»·ÝRuby on railsµÄ¹¤×÷,ÎÒÓ¦¸ÃÖªµÀÄÄЩ֪ʶ ?
    »¹ºÃ,ÎÒ²¢²»ÊÇÏëÖ¸µãÄãʲô,Ö»ÊÇÏë°´ÎÒµÄ˼ά·½Ê½Õ¹ ......

rubyϵͳÃüÁîÎÊÌâ

ÎÒÔÚruby on railsÉÏÖ´ÐÐϵͳÃüÁµ«ÊǸÃϵͳÃüÁÔÚÎÒĬÈϵÄ·¾¶ÉÏÖ´Ðеģ¬¼´/var/www/my¡£ÏÖÔÚÎÒÓÃrubyÓïÑÔ±à³Ì£¬¿É´´½¨ÁËÒ»¸öÐÂĿ¼aaa£¨system "mkdir aaa"¼´¿É£©£¬µ«ÊÇÎÒ²»ÄܽøÈëaaaĿ¼Ï½øÐвÙ×÷ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ