This text is replaced by the Flash movie.

Posts Tagged ‘Visual Studio .Net 2008’

Remove number of words…

May 1st, 2010
Remove number of words at the beginning of string?

Looking for a function that you want to make string only return the last words within the strings? and remove number of words at the beginning Using C#


Windows Form Remove words

This function could help you:
        /// <summary>
        /// Return only last several words  and remove the number of words at the beginning from string.
        /// </summary>
        public static string RemoveFirstWords(string input, int numberWords)
        {
            try
            {
                string[] Split = input.Split(new Char[] { ' ' });
                input = string.Empty; //After passing the words to Split - Empty in again
                for (int i = numberWords; i < Split.Count(); i++)
                {
                    input += Convert.ToString(Split[i]) + " "; //Get Only the last words
                }
                return input;
            }
            catch (Exception)
            {
                // Log the error.
            }
            return string.Empty;
        }
Use the function like this:
private void removeWords_Click(object sender, EventArgs e)
        {
            if (stringToRemove.Text == string.Empty)
            {
                MessageBox.Show("The String is Empty");
            }
            else
            {
                int paramNumOfWords = Convert.ToInt16(numOfwords.Text);
                string returnOnlyLastWords = RemoveFirstWords(stringToRemove.Text.ToString(), paramNumOfWords);
 
                //Return Words
                MessageBox.Show("Return Words: " + returnOnlyLastWords);
            }
        }

Download Source code MVS version 9 C#

Desktop Application Icon

March 4th, 2010

Visual Studio .Net 2008, On Solution Explorer. Right Click. Choose Properties. Select Application, Look for Resources/Icon and Manifest,

Project Settings Visual Studio.net

Browse for Icon you want for the release build.

Application With Custom Icon