diskette
I think AngelScript Urho3D Strings need more descriptions or samples.
What about single-double quotes for Strings?
====== Strings ======:
String[] string1 = { “1”, “2”, “3”, “a”, “b”, “c”};====== Test 1 ======:
String[] string2 = { ‘1’, ‘2’, ‘3’, ‘a’, ‘b’, ‘c’};
String string3 = “123abc”;
String string4 = ‘123abc’;
for(uint x = 0; x < string1.length; x++)Output:
{
Print("STR1: " + string1[x]);
}
for(uint y = 0; y < string2.length; y++)
{
Print("STR2: " + string2[y]);
}
for(uint z = 0; z < string3.length; z++)
{
Print("STR3: " + string3[z]);
}
for(uint w = 0; w < string4.length; w++)
{
Print("STR4: " + string4[w]);
}
STR1: 1 2 3 a b c
STR2: 49 50 51 97 98 99
STR3: 49 50 51 97 98 99
STR4: 52 57
====== Test2 ======:
uint ret_pos = NPOS;Output:
ret_pos = string1.Find(“3”); // ‘’ OR “”
Print("STR1_POS: " + String(ret_pos));
ret_pos = NPOS;
ret_pos = string2.Find(“3”); // ‘’ OR “”
Print("STR2_POS: " + String(ret_pos));
ret_pos = NPOS;
ret_pos = string3.Find(“3”); // ‘’ OR “”
Print("STR3_POS: " + String(ret_pos));
ret_pos = NPOS;
ret_pos = string4.Find(“3”); // ‘’ OR “”
Print("STR4_POS: " + String(ret_pos));
ret_pos = NPOS;
— Single quotes (’’)
STR1_POS: 4294967295
STR2_POS: 2
STR3_POS: 2
STR4_POS: 4294967295
— Double quotes ("")
STR1_POS: 2
STR2_POS: 4294967295
STR3_POS: 2
STR4_POS: 4294967295
====== Test3 ======:
String ltr1, ltr2, ltr3, ltr4; // single letterOutput:
ltr1 = string1[0];
ltr2 = string2[0];
ltr3 = string3[0];
ltr4 = string4[0];
Print("ltr1: “+ ltr1 +” ltr2: “+ ltr2 +” ltr3: “+ ltr3 +” ltr4: "+ ltr4);
ltr1: 1
ltr2: 49
ltr3: 49
ltr4: 52