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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:13:29+00:00 2026-05-24T00:13:29+00:00

I am hoping that by asking this question I find a far more effiecient

  • 0

I am hoping that by asking this question I find a far more effiecient method of doing what it is that I am trying to do.

To start, I have a function whose parameters look as follows:

private void exampleVoid(string filePath, params string[] sourceFile) {

// Code ...

}

**Notice: I am passing the ‘sourceFile’ parameters into a CodeDom method. This method throws an error if any of the parameters are null.**

My call to exampleVoid looks as follows:

exampleVoid(@"C:\test.txt",
"Some Data",
"Some More Data",
"Even more data");

Under certain cercumstances, the second string in the array (labled “Some More Data”) may have to be removed and not passsed to the exampleVoid() method. So, is there some way of removing this string from the array alltogether? Keep in mind that nulling the string out will not work as an exception will be thrown.

Thank you for reading, as well as any further help.

Evan

  • 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-24T00:13:30+00:00Added an answer on May 24, 2026 at 12:13 am

    You cannot remove the string from the array. Creating a new array that includes all other items except the one you want to include is your only option. The code is easy enough:

    // Filters out the second item (zero-based index 1)
    sourceFile = sourceFile.Where((s, i) => i != 1).ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hoping that someone can help clear up this very annoying situation I find myself
I am hoping that this will have a pretty quick and simple answer. I
I have this: And I was hoping that in f1() I will be able
I'm hoping someone can find this problem. I had an app that was fully
I can't find an answer to this question anywhere so I'm hoping someone can
Apologies if this is not a typical SO question, but I'm hoping that someone
I'm assuming the answer to this question is that it's impossible, but I'm asking
This is more of a question about best pattern and practice than asking about
First let me explain why I am asking this question so its clear that
Hoping that using something like this demo it is possible to drag items within

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.