0

I have few controls in my view in which user will entre hex value.

Previously the user was entrying characters. Which i converted using

Alert = Convert.ToByte(collection["Alert"])

Now user wants to enter the value in hex.

I need to read from fromcollection to parse hex value that was entered by user. Then i need to convert that hex into its binary from.

I am new to programming kindly guide me.

2
  • Please read How to ask a good question. Show some code where you have tried to solve the problem. Commented May 22, 2014 at 8:22
  • Thanks wonko79 that was infromative. Commented May 22, 2014 at 8:27

1 Answer 1

0

Try this it is from this post

use syste.linq

string binarystring = String.Join(String.Empty,
  hexstring.Select(
    c => Convert.ToString(Convert.ToInt32(c.ToString(), 16), 2).PadLeft(4, '0')
  )
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.