将字符串str中带有集合中rep[0]的字符串,代替为rep[1]的中的字符串 @param str @param rep @return
(String str, List<String[]> rep)
| 169 | * @return |
| 170 | */ |
| 171 | public static String replace(String str, List<String[]> rep) { |
| 172 | for (String[] item : rep) { |
| 173 | if (item[1] == null) { |
| 174 | item[1] = ""; |
| 175 | } |
| 176 | str = str.replace(item[0], item[1]); |
| 177 | } |
| 178 | return str; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * 创建字符串数组 |
no outgoing calls
no test coverage detected