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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:10:01+00:00 2026-05-13T19:10:01+00:00

byte[] test = Form1.StrToByteArray(simpletext); string encoded_text = BitConverter.ToString(test).Replace(-, ).ToLowerInvariant(); textBox1.Text = encoded_text;//73696d706c6574657874 as from

  • 0

byte[] test = Form1.StrToByteArray(“simpletext”);
string encoded_text = BitConverter.ToString(test).Replace(“-“, “”).ToLowerInvariant();
textBox1.Text = encoded_text;//73696d706c6574657874

as from this line “73696d706c6574657874” to get back “simpletext” ??

//StrToByteArray()

 public static byte[] StrToByteArray(string str)
 {
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            return encoding.GetBytes(str);
 }
  • 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-13T19:10:02+00:00Added an answer on May 13, 2026 at 7:10 pm

    Do you absolutely have to use hex to start with? One slightly more efficient (and reversible with framework methods) option would be to use base 64:

    string base64 = Convert.ToBase64String(test);
    byte[] originalBytes = Convert.FromBase64String(base64);
    string text = Encoding.ASCII.GetString(originalBytes);
    

    I personally wouldn’t suggest using ASCII as your encoding, however – UTF-8 will work the same way for ASCII characters, but allow all of Unicode to be encoded.

    If you do have to use hex, you’ll need a method to parse hex – I have an example here.

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

Sidebar

Related Questions

I'm wondering why the following code doesn't work: String test = new String(new byte[]
byte[] bytes = new byte[] { 1, -1 }; System.out.println(Arrays.toString(new String(bytes, UTF-8).getBytes(UTF-8))); System.out.println(Arrays.toString(new String(bytes,
I am programming in Java I have the code as: byte[] b = test.getBytes();
How to write custom web service load test: All my web services has byte[]
I've declared a byte array (I'm using Java): byte test[] = new byte[3]; test[0]
I need to create a CImage from a byte array (actually, its an array
I'm having trouble creating an Image/Bitmap object in C# from a base64 encoded byte
Is it possible to load a picture from memory ( byte[] or stream or
In bytes_test.go I see: a := Split([]byte(tt.s), []byte(tt.sep), tt.n) where tt.s and tt.sep are
BYTE* pImageBuffer = NULL; eResult res = PlayerLib::CreateImageSnapshot( iPlayerRef, eBMP, &pImageBuffer ); if( res

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.