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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:53:05+00:00 2026-05-31T16:53:05+00:00

I have a List of objects that I would like to convert to a

  • 0

I have a Listof objects that I would like to convert to a byte[]

My List is defined like this:

List<object> objects = new List<object>
{
     "obj1", "obj2", "obj2"
};

Is it possible to convert this list to a byte[] in some clean way? The list only contains base64 strings

All help is appreciated

  • 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-31T16:53:06+00:00Added an answer on May 31, 2026 at 4:53 pm

    Piece of cake:

    objects.Select(s => Convert.FromBase64String(s)).SelectMany(i => i).ToArray();
    

    If objects is really a List<Object> as @AustinSalonen points out, as opposed to a List<String>, you need to make sure that you only have strings first:

    objects.OfType<String>().Select(s => Convert.FromBase64String(s)).SelectMany(i => i).ToArray();
    

    or cast:

    objects.Cast<String>().Select(s => Convert.FromBase64String(s)).SelectMany(i => i).ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List<class> that I would like to convert into a json object
I have a List of String objects that are pipe delimited. something like this:
I have an SQL query that I would like to convert into a criteria
I have a list of key/value pairs and would like to convert it into
I have a list of objects with field UserID, Property: I would like to
I have a list of objects with a DateTime parameter. I would like to
I have a list of objects that have two int properties. The list is
I have a list/collection of objects that may or may not have the same
I have a list of pointers that reference time objects that need a turn
I have a list of IDs for objects that I need to grab, then

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.