如果有一個字串,裡面每個字都由逗點分開。
如:

StringSeperatedByComma1

 

想要把這同個字串的每個字,依照分開的逗點,切分成不同的字串,
請用下面的程式碼:

StringSeperatedByComma2

 

事實上,
可以把上面的逗點可以換成不同的記號,
來用各種不同的記號來分開字串,

StringSeperatedByComma3

 

比方說

StringSeperatedByComma4

 

就可以用

StringSeperatedByComma5

 

來拆分字串

 

依照上面的原理,我做好了兩個函式(程式碼網址 >> https://goo.gl/xyfrEH):

StringSeperatedByComma6

 

使用的話,拷貝上面的函式到您的檔案中,然後這樣使用:

StringSeperatedByComma7

(101)

superstardj

been a DJ, a rapper, a musician and a recording artist... a novel-writer, a language-book author, and a chief editor... a painter, a book-cover designer and many more... right now a programmer who designs mobile application, both iOS and Android devices...

Leave a Reply

Your email address will not be published. Required fields are marked *