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 7445981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:11:17+00:00 2026-05-29T12:11:17+00:00

PHP developer here working with c#. I’m using a technique to remove a block

  • 0

PHP developer here working with c#.
I’m using a technique to remove a block of text from a large string by exploding the string into an array and then shifting the first element out of the array and turning what remains back into a string.

With PHP (an awesome & easy language) it was just

$array = explode('somestring',$string);
array_shift($array);
$newstring = implode(' ', $array);

and I’m done.

I get so mad at c# for not allowing me to create dynamic arrays and for not offering me default functions that can do the same thing as PHP regarding arrays. Instead of dynamic arrays I have to create lists and predefine key structures etc. But I’m new and I’m sure there are still equally graceful ways to do the same with c#.

Will someone show me a clean way to accomplish this goal with c#?

Rephrase of question: How can I remove the first element from an array using c# code.

Here is how far I’ve gotten, but RemoveAt throws a error while debugging so I don’t believe it works:

//scoop-out feed header information
if (entry_start != "")
{
    string[] parts = Regex.Split(this_string, @entry_start);
    parts.RemoveAt(0);
    this_string = String.Join(" ", parts);
}
  • 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-29T12:11:18+00:00Added an answer on May 29, 2026 at 12:11 pm

    I get so mad at c# for not allowing me to create dynamic arrays

    You may take a look at the List<T> class. Its RemoveAt might be worth checking.

    But for your particular scenario you could simply use LINQ and the Skip extension method (don’t forget to add using System.Linq; to your file in order to bring it into scope):

    if (entry_start != "")
    {
        string[] parts = Regex.Split(this_string, @entry_start).Skip(1).ToArray();
        this_string = String.Join(" ", parts);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is how our current php development solution is set up: Each developer work
First post here... I normally develop using PHP and Symfony with Propel and ActionScript
I am working on a PHP function that will recursively remove all sub-folders that
I am hoping there are numerous Twilio developer here along with PHP scripters...I am
Ok, so here is my setup. I am working on a PHP application, which
Okay, here's what I'm trying to do: I'm trying to use PHP to develop
Having been a PHP developer on LAMP servers for quite a while, is there
I'm a PHP developer, and I use the MVC pattern and object-oriented code. I
I'm a PHP developer and now I use Notepad++ for code editing, but lately
I'm a PHP developer who knows a little bit of Ruby. I want to

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.