Returns a value for a key from an info string.
(String s, String key)
| 32 | * Returns a value for a key from an info string. |
| 33 | */ |
| 34 | public static String Info_ValueForKey(String s, String key) { |
| 35 | |
| 36 | StringTokenizer tk = new StringTokenizer(s, "\\"); |
| 37 | |
| 38 | while (tk.hasMoreTokens()) { |
| 39 | String key1 = tk.nextToken(); |
| 40 | |
| 41 | if (!tk.hasMoreTokens()) { |
| 42 | Com.Printf("MISSING VALUE\n"); |
| 43 | return s; |
| 44 | } |
| 45 | String value1 = tk.nextToken(); |
| 46 | |
| 47 | if (key.equals(key1)) |
| 48 | return value1; |
| 49 | } |
| 50 | |
| 51 | return ""; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Sets a value for a key in the user info string. |
no test coverage detected