原本寫了 if else 判斷股票所屬板塊的,覺得繁瑣,就去改了下面的
public static void main(String[] args) { String code ="002348";
String stock = "002".equals(code.substring(0,3)) ? "002" : code.substring(0,1);
System.out.println(stock);
}
然后跑去得瑟,被鄙視了,然后 ↓↓↓↓
public static String getPlateInfo(String code){
return code.startsWith("002") ? "002" : code.substring(0,1);
}
還補了一刀,你看你寫的什么玩意兒,哼,好想讓他跪搓衣板
posted on 2015-07-02 00:26
藤本薔薇 閱讀(231)
評論(0) 編輯 收藏