[Vala] Starting with Vala, problems with strings
- From: Diego Jacobi <jacobidiego gmail com>
- To: vala-list gnome org
- Subject: [Vala] Starting with Vala, problems with strings
- Date: Sun, 19 Apr 2009 20:39:54 +0200
Hi.
This may be a too much newbie question, but:
How do you access a character in a string?
private static int my_string_handler(string *str)
{
string s;
for (x = 0 ; x < str->len() ; x++)
{
if (str[x]=='+')
{
s = str->substring(0,x);
stdout.printf("plus finded at = %d, left string ist %s\n", x, s);
return 0;
}
}
return -1;
}
This prints an error saying that str is not an array.
I cant find anything on the docs an example on how to manipulate
strings char by char.
Cheers.
Diego
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]