最終更新:2012-01-07 (土) 16:32:44 (4484d)  

文字列
Top / 文字列

C言語

  • char[]

C++/文字列

  • string = typedef basic_string<char> string;

Visual C++/文字列

C♯

リテラル

  • リテラル文字列? ("hello world!")
    • エスケープシーケンスが有効
  • 逐語的リテラル文字列? ( @"hello world!")
    • エスケープシーケンスが無効
string a = "hello, world";                  // hello, world
string b = @"hello, world";               // hello, world
string c = "hello \t world";               // hello     world
string d = @"hello \t world";               // hello \t world
string e = "Joe said \"Hello\" to me";      // Joe said "Hello" to me
string f = @"Joe said ""Hello"" to me";   // Joe said "Hello" to me
string g = "\\\\server\\share\\file.txt";   // \\server\share\file.txt
string h = @"\\server\share\file.txt";      // \\server\share\file.txt
string i = "one\r\ntwo\r\nthree";
string j = @"one
two
three";

Delphi

  • string

VB.NET

VB

  • String

Objective-C