[Vala] Apply a RegEx in Vala
- From: David Gomes <davidrafagomes gmail com>
- To: vala-list <vala-list gnome org>
- Subject: [Vala] Apply a RegEx in Vala
- Date: Fri, 2 Dec 2011 19:00:06 +0000
I read the ValaDoc on RegEx's and the example in live.gnome.org.
However, I couldn't figure out how to apply regular expressions in Vala.
I have this:
var my_regex = new Regex ("[^a-zA-Z0-9]");
string my_string = "Hello World()///";
my_regex.replace (my_string, my_string.length, 0, "");
print ("%s\n", my_string);
This snippet should remove all spaces and spaces and symbols. However,
it doesn't seem to be working. Any ideas? Thanks in advance.
--
David Gomes
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]