C#String.Split (string[], StringSplitOptions)中的StringSplitOptions是什麼意思,看了msdn還是不懂?

來源:互聯網
上載者:User

標籤:des   http   io   os   ar   sp   div   2014   on   

MSDN上面這樣子寫的:

[ComVisibleAttribute(false)]

public string[] Split(string[] separator,StringSplitOptions options)
參數
separator
類型:System.String[]
分隔此字串中的子字串的字串數組、不包含分隔字元的空數組或 null。

options
類型:System.StringSplitOptions
要省略返回的數組中的空數組元素,則為 RemoveEmptyEntries;要包含返回的數組中的空數組元素,則為 None。

傳回值
類型:System.String[]
一個數組,其元素包含此字串中的子字串,這些子字串由 separator 中的一個或多個字串分隔。 有關更多資訊,請參見“備忘”一節。
分享到:  2014-04-05 21:37 提問者採納答題闖關,過關即送禮!快來參加~ 
   class Program    {        static void Main(string[] args)        {            string s = "123,abc1ab";            string[] aa = s.Split(new char[] { ‘,‘‘1‘ }, StringSplitOptions.RemoveEmptyEntries);            string[] bb = s.Split(new char[] { ‘,‘ ‘1‘});        }    }

追問
很是感謝!!!這個局部變數的框是從哪兒開啟的??
回答
按F10 逐步執行,在VS底部會出現這個“局部變數”;
追問
找到了,但是不會用,運行完了,怎麼數組中的值怎麼都是空的?
回答
一定要按F10 啟動單步調試,只有在單步偵錯模式下才能查看局部變數;
追問
沒有單步調試啊,只有逐語句。。。。。
回答

C#String.Split (string[], StringSplitOptions)中的StringSplitOptions是什麼意思,看了msdn還是不懂?

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.