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 3 years have passed since last update.

文字列の初期化集

Posted at

概要

いくつかのプログラミング言語における、文字列の定義と初期化の方法を記しました。
変数名はsValに統一しています。

随時編集する可能性あります。

文字列の定義と初期化例

C

char *sVal;

arduino

String sVal;

matlab /octave

sVal = ''

python3

sVal = ''

javascript

var sVal = String();

c#

string sVal = string.Empty;
string? sVal = null; //nullable

c++

string sVal;

kotlin

var sVal : String
var sVal : String? = null //nullable

java

String sVal = new String();

Swift

var sVal : String
var sVal : String? //optional

なでしこv1

sValは文字列
0
0
1

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?