2009年11月20日 星期五

[Java]字串轉數字

◆ 功能說明:將字串(String)轉換成數字(Int)型態


◆ 範例







Example







1
2



int i = Integer.valueOf(str).intValue();

int i = Integer.parseInt(str);


◆ 資料來源:http://fredwang.blogspot.com/2005/07/java.html

沒有留言:

張貼留言