Grab the contents of a file as a string. Connects lines with \n, even if the input file used \r\n.
(File file)
| 189 | * even if the input file used \r\n. |
| 190 | */ |
| 191 | static public String loadFile(File file) { |
| 192 | if (file != null && file.exists()) { |
| 193 | String[] contents = PApplet.loadStrings(file); |
| 194 | if (contents != null) { |
| 195 | return PApplet.join(contents, "\n"); |
| 196 | } |
| 197 | } |
| 198 | return null; |
| 199 | } |
| 200 | |
| 201 | |
| 202 | /** |
no test coverage detected