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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:01:49+00:00 2026-05-31T01:01:49+00:00

Is it possible to initialize a String from an array of hex values, like

  • 0

Is it possible to initialize a String from an array of hex values, like C style?

unsigned char[] charArray = {0x41, 0x42, 0x43};

Why is not possible to do something like this?

String charArray = new String((byte[]) {0x41, 0x42, 0x43});
  • 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-31T01:01:51+00:00Added an answer on May 31, 2026 at 1:01 am

    It is perfectly possible, you can do it in several ways.

    • Using unicode escapes:

      String string = "\u0041\u0042\u0043";
      
    • Creating and using a byte array:

      String string = new String(new byte[] {(byte) 0x41, (byte) 0x42, (byte) 0x43});
      

    The main thing you have to remember is that the string is not an array of something, it is a separate object. Therefore it should either be created as a string literal, or with one of the constructors.

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

Sidebar

Related Questions

I would like to initialize a new string array from the values contained in
I would like to use ConfigurationManager to access some string values from a static
In C++, it's not possible to initialize array members in the initialization list, thus
Is it possible in c# to initialize an array in, for example, subindex 1?
Is it possible to do the following (e.g. initialize bool array and set all
Is it possible to initialize a variable from a return parameter (by ref)? Say
i was wondering if it's possible to initialize a constant in an interface from
Would it be possible to initialize a vector array of strings? for example: static
I've noticed it's possible to return a string like Visible, Collapsed, Images/xyz.png or #FFB3D1
Why is not possible to initialize a property to a function when you declare

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.