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

  • SEARCH
  • Home
  • 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 9199763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:36:35+00:00 2026-06-17T22:36:35+00:00

I have 5 strings, let’s call them EarthString FireString WindString WaterString HeartString All of

  • 0

I have 5 strings, let’s call them

  • EarthString
  • FireString
  • WindString
  • WaterString
  • HeartString

All of them can have varying length, any of them can be empty, or can be very long (but never null).

These 5 strings are very good friends, and every weekend they are concatenated to form a result string using this c# statement

ResultString = EarthString + FireString + WindString + WaterString + HeartString

Depending on the values of these strings, sometimes (only sometimes), ResultString will contain “Captain Planet” as a substring.

My question is, how do I manipulate each of the 5 strings before they are concatenated, so that when they are combined, “Captain Planet” will never appear as a substring in the resultant string?

The only way I can think of right now is to examine each character in each string, in sequential order, but that seems very tedious. Since each of the 5 good friends strings can be of any length, examining the characters individually will also require some kind of concatenation before we can determine whether any character need to be dropped.

Edit: The resultant string is a filtered version of the 5 strings concatenated together, all the other content remain the same except the “Captain Planet” string is dropped. Yes, i’m looking for a solution which allows the 5 strings to be manipulated before concatenation. (this is actually a simplification of a bigger programming problem i’m encountering). Thanks guys.

  • 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-06-17T22:36:37+00:00Added an answer on June 17, 2026 at 10:36 pm

    If you want to do it pre-concat you could

    Assign the start and end of each string a numeric value based on the portion of “CaptainPlanet” they contein. Ex: if Air = “net the big captain” then it would get 3 for a start value and 7 for an end value. to determine if you could concat 2 values safely you would just check to see if the end of the left string + start of the right string were not equal to the total length of “CaptainPlanet”. If you had very large strings this would allow you to inspect just the first x and last x characters of the string to compute the start/end value.

    This solution doesn’t account for short strings like ei air = “Cap” , earth =”tain” and fire=”Planet”. In that case you would need to have a special case for tokens that are shorter than the length of “CaptainPlanet” For those.

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

Sidebar

Related Questions

Let's say I have these two strings: 5/15/1983 and 1983.05.15. Assume that all characters
Let's say I have a short list of strings, that can contain duplicates: <A,
I have a source of strings (let us say, a text file) and many
Let's say I have strings like this: PH&N 2015 LifeTime Series D PH&N 2020
I have an array with french strings let say: égrener and exact I would
Let's say I have two strings: one is XML data and the other is
Let's say I have two strings like this: XABY XBAY A simple regex that
Let's say I have two same strings inside an ArrayList... is there a way
Let's say I have the following three strings: (section1){stuff could be any character, i
Let me tell you my requirement first, I have strings stored in one string

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.