Most reliable split character

后端 未结 11 1990
忘掉有多难
忘掉有多难 2021-01-31 01:49

Update

If you were forced to use a single char on a split method, which char would be the most reliable?

Definition of reliable: a split charact

11条回答
  •  一生所求
    2021-01-31 02:55

    \0 is a good split character. It's pretty hard (impossible?) to enter from keyboard and it makes logical sense.

    \n is another good candidate in some contexts.

    And of course, .Net strings are unicode, no need to limit yourself with the first 255. You can always use a rare Mongolian letter or some reserved or unused Unicode symbol.

提交回复
热议问题