SoFunction
Updated on 2025-03-07

How to find and replace strings from specified strings in C#?

        private void find_Click(object sender, EventArgs e)
        {
            string str1;
            str1 = txt_find.Text;
            if (start >= )
            {
("To find the tail");
                start = 0;
            }
            else
            {
                start = (str1, start, );
                if (start == -1)
                {
                    if (count == 0)
                    {
("No such character!");
                    }
                    else
                    {
("To find the tail!");
                        start = 0;
                    }
                }
                else
                {
                    start = start + ;
                    ();
                }
            }
        }
        /// <summary>
/// Replace string
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void replace_Click(object sender, EventArgs e)
        {
            = (txt_find.Text, txt_replace.Text);
        }
        /// <summary>
/// Enter the string to look for
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void txt_find_TextChanged(object sender, EventArgs e)
        {
            string str1;
            str1 = txt_find.Text;
            start = 0;
            count = 0;
        }