1. 程式人生 > >[Java]求一個字串中冒號的個數

[Java]求一個字串中冒號的個數

int count = key.length() - key.replaceAll(":", "").length();