Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 511281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:12:01+00:00 2026-05-13T07:12:01+00:00

If I have two strings .. say string1=Hello Dear c’Lint and string2=Dear .. I

  • 0

If I have two strings ..
say

string1=”Hello Dear c’Lint”

and

string2=”Dear”

.. I want to Compare the strings first and delete the matching substring ..
the result of the above string pairs is:

“Hello  c’Lint”

(i.e, two spaces between “Hello” and “c’Lint”)

for simplicity, we’ll assume that string2 will be the sub-set of string1 .. (i mean string1 will contain string2)..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T07:12:02+00:00Added an answer on May 13, 2026 at 7:12 am

    Do this only:

    string string1 = textBox1.Text;
    string string2 = textBox2.Text;
    
    string string1_part1=string1.Substring(0, string1.IndexOf(string2));
    string string1_part2=string1.Substring(
        string1.IndexOf(string2)+string2.Length, string1.Length - (string1.IndexOf(string2)+string2.Length));
    
    string1 = string1_part1 + string1_part2;
    

    Hope it helps. It will remove only first occurance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 537k
  • Answers 537k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, nodeValue will give you the node's value. You want… May 17, 2026 at 1:41 am
  • Editorial Team
    Editorial Team added an answer You don't need to change shells back again. When the… May 17, 2026 at 1:41 am
  • Editorial Team
    Editorial Team added an answer orderby (a.Id == someId ? 1 : 2) That make… May 17, 2026 at 1:41 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

We have two lists, let's say students and their scores. I want to compare
Let's say I have these two arrays: string[] arr1 = new string[2]{Hello, Stack} string[]
Let's say I have two same strings inside an ArrayList... is there a way
I have two cells lets say: A1 and A2 The content of each one
Let's say I have this Hello.scala. object HelloWorld { def main(args: Array[String]) { println(Hello,
Say I have a string like: string hex = 48656c6c6f; Where every two characters
I have a date string, say ' 2008-09-11 '. I want to get a
Let's say I have two entities: Physician Credentials And a physician can have many
Long story short, I have two regex patterns. One pattern matches things that I
I have two secondary threads,that executes the method WriteX as described below: static void

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.