2,617
次編輯
Tankianting(討論 | 貢獻) |
Tankianting(討論 | 貢獻) (→其他) |
||
行 51: | 行 51: | ||
# 得到 UTF-8 字串長度的方法:[https://docs.rs/unicode-segmentation/1.6.0/unicode_segmentation/index.html UnicodeSegmentation::graphemes](參見:[https://stackoverflow.com/questions/46290655/get-the-string-length-in-characters-in-rust Stack Overflow]) | # 得到 UTF-8 字串長度的方法:[https://docs.rs/unicode-segmentation/1.6.0/unicode_segmentation/index.html UnicodeSegmentation::graphemes](參見:[https://stackoverflow.com/questions/46290655/get-the-string-length-in-characters-in-rust Stack Overflow]) | ||
# [https://stackoverflow.com/questions/45519176/how-do-i-use-or-import-a-local-rust-file 匯入外部函式庫] | # [https://stackoverflow.com/questions/45519176/how-do-i-use-or-import-a-local-rust-file 匯入外部函式庫] | ||
===印出當前目錄(current directory)=== | |||
<pre> | |||
use env; | |||
... | |||
println!("{:?}", env::current_dir()); | |||
</pre> | |||
執行結果: | |||
<code>Ok("/home/yoxem/桌面/TMP/240306 臺語實驗/pakkau/pakkau/src")</code> | |||
==變數== | ==變數== |