0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

改行コード:Environment.NewLine

Last updated at Posted at 2015-01-16

 機能の修正中に、他の人の描いたソースってのは結構参考になるなあなんて思いながら見ていたら、string.Joinのセパレートの引数に「Environment.NewLine」って書いてあったのを見て、何じゃこりゃ、って思って調べたら、なんと改行コードだったよこれ。

Environment.NewLine プロパティ
この環境で定義されている改行文字列を取得します。
(msdnより引用)

 ディレクトリの区切り文字はPath.DirectorySeparatorCharってのは結構前から知ってたんだけどこれは知らんかったなあ……。

Path.DirectorySeparatorChar フィールド
階層ファイル システム編成を反映するパス文字列の、ディレクトリ レベルを区切るために使用する、プラットフォーム固有の文字を提供します。
(msdnより引用)

 しかし、Environmentクラスって特殊ディレクトリのパスを取ってこれるだけのクラスだと思ってたら違うんだね……!
 なんかメンバの一覧見たら、改行文字だけ浮いてねえ? って思ったのはここだけの話。


参考ここらへん

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?