| 发表于:2007-07-25 10:58:10 楼主 |
程序如下: using system; using system.collections.generic; using system.text; namespace consoleapplication27 { class program { static string getword(params string[]firstword) { return firstword[0]; } static void main(string[] args) { string firstword = getword( "this is a sentence. ");//字符串转化为数组了 console.writeline(firstword); } } } 问题: 怎么通过getwor函数得到字符串 "this is a sentence. "中的单个单词,例如 "this "或者 "sent ",谢谢. 还有,在函数调用的开始,系统自动把字符串 "this is a sentence. "转化为string[]firstword数组了吗? |
|
|
|
|