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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:46:23+00:00 2026-06-17T10:46:23+00:00

I need to turn string into an array of integers. Each array slot would

  • 0

I need to turn string into an array of integers. Each array slot would contain one letter in integer value. For example, string omg would be returned as something like

array[0] = 13; array[1] = 44; array[3] = 26; 

EDIT These values of letters are thought up. I just want to know if there is a method to turn letters to integers.

Is there any builtin method for this?

  • 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-06-17T10:46:24+00:00Added an answer on June 17, 2026 at 10:46 am

    There are a varieties of ways of doing this, depending on exactly what you mean by “turn letters to integers”.

    • You can use String.getBytes() to encode the string into the system’s default encoding and give you that as a byte[]. The byte type is an integer type.

    • You can use String.toCharArray() to give you the string’s characters. The char type is an integer type.

    • You could do various other “mystery” transformations on the string; e.g. apply Caeser’s cipher to each string character to give you a letter that you then turn into a number.

    And you could then write a loop to turn a char[] or byte[] into an int[], but there is no built-in method to do this step of the transformation … if that’s what you need.

    Note that the first two approaches may give you different integers, depending on the string value and the system’s default character encoding. It is important that you understand what you are trying to do with this conversion …


    (I’m assuming that the example transformation in the Question should not be taken literally …)

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

Sidebar

Related Questions

I need to read a file and turn it into a string array but
I need to convert an array of strings and integers into a conjoined string,
I need to split a keyword string and turn it into a comma delimited
I have a string like 1-350,9-390.99,... , and I need to turn it into
I need to turn a string such as this: 'apple orange banana pear' into
I need to turn this phone number: 5555555555 into this string with delimiters: 555.555.5555
I need to convert one array structure into another array structure. I hope someone
Need a quick and easy way to turn a file, into a string I
I have an array of strings and I need to turn them into quoted
I need to turn the following results... RowID ColumnName Value ======= ============ ========== 200

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.