Re: Parsing throught text entry



Marco Quezada wrote:

file name is 1350235E123A.ascii

after the name has been entered I need to extract the strings 023 and
123 from the name.  The file name is being set in a gchar pointer called
ascii_file_name. Is there a way to "parse" the pointer to extract the
desired digits and place them into a new text entry?

gchar *str1, *str2;

str1 = g_strndup (ascii_file_name + 3, 3);
str2 = g_strndup (ascii_file_name + 8, 3);

...

gtk_entry_set_text (GTK_ENTRY (...), str1);
gtk_entry_set_text (GTK_ENTRY (...), str2);

...

g_free (str1);
g_free (str2);

Untested.

WL




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