String array in Vala #93
Answered
by
ChildishGiant
ChildishGiant
asked this question in
Q&A
-
I know this is incredibly basic but I can't seem to make an array of strings in Vala? The closest thing I can find on the docs is this code that seems to cast each character to an int. uint8[] chars = "hello world".data;
chars.move (6, 0, 5);
print ((string) chars); // "world "
|
Beta Was this translation helpful? Give feedback.
Answered by
ChildishGiant
Jun 27, 2021
Replies: 1 comment
-
Classic, as soon as I ask this I work it out. string[] foo = {};
foo += "hello world"; In case you're wondering how I messed up something so basic, it's because I was trying to use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ChildishGiant
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Classic, as soon as I ask this I work it out.
In case you're wondering how I messed up something so basic, it's because I was trying to use
var
andstring[]
in one line