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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:34:03+00:00 2026-05-25T14:34:03+00:00

I’m using a list to store a pair of hexadecimal values (eg. in the

  • 0

I’m using a list to store a pair of hexadecimal values (eg. in the list AD38F2D8, displayed as:Value_A: AD 38 F2 D8).

My question is should I use a Dictionary<string, string> or should I use Dictionary<string, NewCustomObject> to store the hexadecimal string as a pair of strings. (Value: [AD, 38, F2, D8]) instead of (Value: AD38F2D8).

It probably won’t make to much of a difference between the two.

With Dictionary<string, string> I would just store each hex string in the dictionary, and then split them up in their respective pairs when I need them.
if I use the Dictionary<string, NewCustomObject> I would end up first splitting the hex strings in their respective pairs and then store them in the dictionary.

My question is which should I use? Or should I just keep using lists?

It’s not entirely necessary for me to use Dictionary<string, string> as I would still know which index what string is on, just that it would look nicer.

List example:

Index = 0,  Value = 3D95FF08
Index = 1,  Value = 8D932A08

Dictionary<string, string> example:

Index = 0, Key = First,  Value = 3D95FF08
Index = 1, Key = Second, Value = 8D932A08

Dictionary<string, NewCustomObject> example:

Index = 0, Key = First,  Value = 3D, 95, FF, 08
Index = 1, Key = Second, Value = 8D, 93, 2A, 08

NOTE: the Index value in each dictionary example is just to show the corespondence to the others, I know a dictionary does not have Index values but uses keys instead. it’s just makes it easier to look at this example.

I came across the last Dictionary string here: C# Dictionary with two Values per Key?
I was searching for it as I have used that way several times while writing python code. by storing a list of strings within a dictionary.

Thanks in advance for any help!

EDIT

Each string in either the list or dictionary, would be split in their respective bytes.
EG.

BYTE   0   1   2   3 to  6 .....
HEX    AD  12  01  0000859D  .....

Byte 0 would hold the Index
Byte 1 would hold the Reference
Byte 2 the Flags
Byte 3 to 6: The Memb_Number_ID

Therefore, if I split them up before possibly putting these in the dictionary I don’t have to do it before I use them in their respective place as I would have to split them up to calculate the index, reference and flags.

The database was given to me in this format, I am forced to work with it the way it currently is, so i can not change it. and can only adapt my code to it.

above example would be outputted as:

Index  Reference Link    Flags          Memb_Number_ID
173     18               +A             John (ID: 34205)
  • 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-25T14:34:03+00:00Added an answer on May 25, 2026 at 2:34 pm

    Dictionaries do not expose indexes, they don’t have the concept. I’d stick with a list:

    List<NewCustomObject> myHexValues;

    And if you need to search through it, you can use LINQ. Only use dictionaries if you need fast access based on a defined key.

    You haven’t really stated how you intend to use the collection, so no one can really tell you to use one or the other as yet – I’m only guessing based on the fact you want index values.

    Update: if you want easier access to elements of the hex value, you can either use a rectangular array or wrap the value in a custom type and expose properties for the different parts (your choice on struct vs class, depends on the values I suppose), and then stick that type in a list.

    If you make your own type, you can expose an indexer if you wish to get the following syntax:

    myCustomType[indexKey] = value;

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the

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.