Name |
saveStrings()保存字符串 |
||||||
Examples |
String words = “apple bear cat dog”; String[] list = split(words, ‘ ‘);
// Writes the strings to a file, each on a separate line saveStrings(“nouns.txt”, list); |
||||||
Description |
Writes an array of Strings to a file, one line per String. By default, this file is saved to the sketch’s folder. This folder is opened by selecting “Show Sketch Folder” from the “Sketch” menu. Alternatively, the file can be saved to any location on the computer by using an absolute path (something that starts with / on Unix and Linux, or a drive letter on Windows). Starting with Processing 1.0, all files loaded and saved by the Processing API use UTF-8 encoding. In earlier releases, the default encoding for your platform was used, which causes problems when files are moved to other platforms. 将字符串数组写入文件, 每个字符串中有一行。默认情况下, 此文件保存到草绘的文件夹中。通过从 “草绘” 菜单中选择 “显示草图文件夹” 打开此文件夹。
或者, 该文件可以通过使用绝对路径 (在 unix 和 linux 上启动的东西, 或 windows 上的驱动器号) 保存到计算机上的任何位置。
从处理1.0 开始, 处理 api 加载和保存的所有文件都使用 UTF-8 编码。在早期版本中, 使用了您的平台的默认编码, 这会导致在将文件移动到其他平台时出现问题。 |
||||||
Syntax |
saveStrings(filename, data) |
||||||
Parameters |
|
||||||
Returns |
void |
||||||
Related |
loadStrings() |
- 本文固定链接: http://iprocessing.cn/2017/08/02/savestrings保存字符串/
- 转载请注明: 卡萨布兰卡 于 Processing编程艺术 发表