記事更新日: 2018年06月05日
文字列を char型の配列に変換しようぜ☆
- Let's convert a string to an array of type char.
C の文字列は char型なのよ!
- The character string of C is a char type!
std::string str("raion"); const char* cstr = str.c_str();
わかんないわね。
- I do not know.
2016.08.03「【C++】string型をcharに変換/コピーする方法【値 配列 ポインタ string to char】」MaryCore
char[] characters = "らいおん".ToCharArray();
これでいいんじゃないか☆?
- Is not it OK with this?
2015-11-26「C# - How to convert string to char?」stack overflow
String str = "Raion"; char c = str.charAt(0); // 'R' char[] arr = stc.toCharArray(); // ['R','a','i','o','n']
これでいいはず☆
- This should be okay.
2011-10-21「How to convert/parse from String to char in java?」stack overflow
var str = "Raion"; var c = str.charAt(0);
これでいいだろ☆
- Is this OK?
string.byte("RAION",2) // A=65
多分、こうなるはず☆
- Probably, it should be like this.
my @arr = split //, "raion";
一文字ずつに分ければいいのだろう☆
- You ought to divide it by character.
$str = "Raion"; $arr1 = str_split($str);
まあ、がんばれだぜ☆
- Well, good luck!
str = "Raion" list(str)
こんなんでいいのだろうか☆?
- I wonder if this is OK?
'Raion'[0]
ふーん☆
- Hmm.
let s = "Raion".as_bytes();
おっけ☆!
- Ok!