Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
5.6 以分隔符號分割字串
|
201
5.6 以分隔符號分割字串
問題點
你想以指定的字元或模式分割字串。
解決方案
StringSplit[]
指令提供多樣化的選項分割字串。預設以空白字元作為分隔符號。
可指定其他字元或更廣泛的字串模式作為分割的標準。以下指定逗號串接零個以上的空
白字元為分隔方式。[Page-201]
如果有數個分隔符號,可提供其串列作為分割標準。以下範例可進一步以逗號分割日期。
討論說明
StringSplit
指令也支援規則式的使用,這衍生出一些有趣的應用,例如對輸出進行強
調功能。以下對 XML 進行格式化輸出,將 XML 指令、註解與標籤設定不同的字型與
顏色顯示(由於本書為黑白印刷,看不出顏色差異,請讀者在自行執行並觀察輸出結
果)。
ch05.indd 201 2014/4/2 上午 06:13:14
202
|
第五章
5.7 使用內建單字集
問題點
你想進行語言方面的處理,並需要可靠的詞彙。[Page-202]
解決方案
Mathematica 6 開始,內建許多好用的線上資料,其中之一是整合了英文單字集(其
他語言的單字集也可以另外安裝)。
ch05.indd 202 2014/4/2 上午 06:13:14
5.7 使用內建單字集
|
203
尋找
th
開頭而
y
結尾的單字。
尋找以
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106