Re: [Vala] string starts_with



On Tue, Jan 25, 2011 at 8:39 AM, Juergen <jota gmx de> wrote:
Hi,

I am wondering if there is some kind of string.starts_with method in
vala.
I try to avoid a memory-allocating algorithm like

       if ("Hello World"[0:5] == "Hello")

but do not know how to implement this without a starts_with method.

Have you seen the has_prefix method?
http://valadoc.org/glib-2.0/string.has_prefix.html

Regards,
Alex



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]