Contact: aviboots(AT)netvision.net.il
39,912 questions
51,844 answers
573 users
using System; class Program { static void Main() { string s = "vb.net javascript php c c++ python c#"; int pos = s.LastIndexOf(" "); string last_word = pos > -1 ? s.Substring(pos + 1) : s; Console.Write(last_word); } } /* run: c# */
using System; class Program { static void Main() { string s = "vb.net javascript php c c++ python c#"; string[] array = s.Split(' '); string last_word = array[array.Length - 1]; Console.Write(last_word); } } /* run: c# */