how to convert ACSII to HEX

how to convert ACSII to HEX

How to convert perticular ASCII charecter(~)"TILDA" from a no. of files to NULL(00:HEX value). ASCII value of ~7e HEX value of ~:00

View Answers

June 1, 2012 at 5:31 PM

The given code accepts the string and convert this String to char array, cast it to integer(decimal) followed by Integer.toHexString() to convert it to Hex value.

class ConvertAsciiToHex 
{
    public static void main(String[] args) 
    {
        String str="Hello World";
        char[] chars = str.toCharArray();

      StringBuffer hex = new StringBuffer();
      for(int i = 0; i < chars.length; i++){
        hex.append(Integer.toHexString((int)chars[i]));
      }
        System.out.println(hex.toString());
    }
}

June 2, 2012 at 4:35 AM

Great stuff guyes... Could u pls let me know,How it can be done when we have bulk of files as input and perform the character conversion for any particular char only in all files!!!!!!









Related Tutorials/Questions & Answers:
how to convert ACSII to HEX
how to convert ACSII to HEX  How to convert perticular ASCII charecter(~)"TILDA" from a no. of files to NULL(00:HEX value). ASCII value of ~7e HEX...() to convert it to Hex value. class ConvertAsciiToHex { public static void
Convert a string representation of a hex dump to a byte array using Java?
Convert a string representation of a hex dump to a byte array using Java?  Convert a string representation of a hex dump to a byte array using Java
Advertisements
ModuleNotFoundError: No module named 'hex'
ModuleNotFoundError: No module named 'hex'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'hex' How to remove the ModuleNotFoundError: No module named 'hex' error
ModuleNotFoundError: No module named 'hex-ocr'
ModuleNotFoundError: No module named 'hex-ocr'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'hex-ocr' How to remove the ModuleNotFoundError: No module named 'hex-ocr
ModuleNotFoundError: No module named 'hex-grid'
ModuleNotFoundError: No module named 'hex-grid'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'hex-grid' How to remove the ModuleNotFoundError: No module named 'hex-grid
ModuleNotFoundError: No module named 'hex-utils'
'hex-utils' How to remove the ModuleNotFoundError: No module named 'hex...ModuleNotFoundError: No module named 'hex-utils'  Hi, My Python... have to install padas library. You can install hex-utils python with following
How do I change a large string into hex and then into byte so that SHA1 can be applied to it?
How do I change a large string into hex and then into byte so that SHA1 can... on a daily basis. So instead of searching online for a MEID (a hex number of length 14) to pseudo ESN (a hex number of length 8) calculator, I figured I can make my
ModuleNotFoundError: No module named 'redsolutioncms.django-hex-storage'
: ModuleNotFoundError: No module named 'redsolutioncms.django-hex-storage' How to remove the ModuleNotFoundError: No module named 'redsolutioncms.django-hex-storage'...ModuleNotFoundError: No module named 'redsolutioncms.django-hex-storage' 
ModuleNotFoundError: No module named 'string_to_hex_color'
named 'string_to_hex_color' How to remove the ModuleNotFoundError: No module named 'string_to_hex_color' error? Thanks   Hi...ModuleNotFoundError: No module named 'string_to_hex_color'  Hi, My
How to convert into to String in Java?
How to convert into to String in Java?  Hi, How to convert into to String in Java? Thanks
How to Convert ArrayList to Array?
How to Convert ArrayList to Array?  Hi, I am trying to learn to Convert ArrayList to Array. How it is possible? How to Convert ArrayList to Array? Thanks   Hi, To Convert ArrayList to array ArrayList.toArray
How to convert NSString to NSInteger?
How to convert NSString to NSInteger?  Hi, Provide me code to convert NSString into NSInteger. Thanks   Hi, Use the following code example: NSString * s= @"100"; NSInteger i = [s intValue]; Thanks
How to Convert String to Date?
How to Convert String to Date?  Hi, I am new in Java and learning... have to convert it to Date object. Tell me How to Convert String to Date? Thanks   Hi Dude, Its very easy to convert the String into date format
How to convert a String to an int?
How to convert a String to an int?  I my program I am taking... format. Now I want to convert into int value. Tell me How to convert a String... contains the value 1025, then you can use the following code to convert the String
How to convert String into java.util.Date
How to convert String into java.util.Date  Hi, How I can convert String date into java.util.Date in a Java program? Thanks   Hi... Getting time in Milliseconds Convert Date To Calendar How to convert String Date
how to convert jsp to exe
how to convert jsp to exe  hello sir, i am doing webapplication. the configuration is windows xp operating system,IE6.0,apache... to another system. so i want to convert this to exe. that will executed only internet
how to convert sql into hql
how to convert sql into hql   StringBuffer questionDataSql = new StringBuffer(); questionDataSql.append( "select...,'') branchingLogic ") .append("FROM question q left join
HOW TO CONVERT THIS CODE INTO GUI
HOW TO CONVERT THIS CODE INTO GUI   System.out.println("\n\t UGANDA CHRISTIAN UNIVERSITY\n"); System.out.println("\n\tFACULTY OF SCIENCE AND TECHNOLOGY\n"); System.out.println("\n BACHELOR OF SCIENCE IN COMPUTER
hex to binary convertion in java - Java Beginners
hex to binary convertion in java  HI, im doin a application wch requires to send a binary message to other mobiles, so i need to convert the hex values to binary format.So the binary format could either be a ringtone
hex to binary convertion in java - Java Beginners
hex to binary convertion in java  HI, im doin a application wch requires to send a binary message to other mobiles, so i need to convert the hex values to binary format.So the binary format could either be a ringtone
hex to binary convertion in java - Java Beginners
hex to binary convertion in java  HI, im doin a application wch requires to send a binary message to other mobiles, so i need to convert the hex values to binary format.So the binary format could either be a ringtone
how to convert all the pixel value to hexadecimal and from hexadecimal to binary in vb.net
how to convert all the pixel value to hexadecimal and from hexadecimal... that i need to convert all the pixel values into hexadecimal how it can be done in for loop and to convert that hex to bin for all the pixels please`Dim xmax
How to convert XML file to database ?
How to convert XML file to database ?  How to convert XML file to database
How to convert string to byte in Java
How to convert string to byte in Java  How to convert string to byte in Java
how to convert string to image in java
how to convert string to image in java  how to convert string to image in java? I know we need to convert image to a byte array at some point in my application but do not know how to convert a image into byte string. Please
How to convert a swing form to PDF
How to convert a swing form to PDF  Sir, I want to know about how convert a swing form containing textbox,JTable,JPanel,JLabel, Seperator etc swing menus to a PDF file using java code
How to convert eclipse project to Maven
How to convert eclipse project to Maven  Hi, I have a Eclipse Project which is developed using Eclipse. Now I want to use the Maven to build the project. Let's know how to convert it to the Maven Project. Thanks
how to convert string to double in java
how to convert string to double in java  Hi, I have String variable with double value in it. how to convert string to double in java? Thanks  ... to convert a String into double. Here is full example code: package net.roseindia
how to convert string to double in java
how to convert string to double in java  Hi, I have String variable with double value in it. how to convert string to double in java? Thanks  ... to convert a String into double. Here is full example code: package net.roseindia
how to convert string to double in java
how to convert string to double in java  Hi, I have String variable with double value in it. how to convert string to double in java? Thanks  ... to convert a String into double. Here is full example code: package net.roseindia
how to convert string to double in java
how to convert string to double in java  Hi, I have String variable with double value in it. how to convert string to double in java? Thanks  ... to convert a String into double. Here is full example code: package net.roseindia
how to convert yyyyMMdd to date in python
how to convert yyyyMMdd to date in python  Hi, I have a date string 20221231 and I want to convert it to the date in Python. how to convert... for this. Above example shows you how to do it? Thanks   Hi, Here
how to convert yyyyMMdd to date in python
how to convert yyyyMMdd to date in python  Hi, I have a date string 20221231 and I want to convert it to the date in Python. how to convert... for this. Above example shows you how to do it? Thanks   Hi, Here
how to convert json into dataframe in scala
how to convert json into dataframe in scala  Hi, I have a JSON string and I want to convert it to dataframe in scala. how to convert json... want to convert it to dataframe in scala for spark. Thanks   Hi
How to Convert NSStringe into Uppercasestring iPhone
How to Convert NSStringe into Uppercasestring iPhone  Hi... how to convert nsstring into uppercasestring in iphone Application. Thanks..., For how to convert nsstring into uppercasestring in iphone Application. Please
How to convert Collection to Array in Java?
How to convert Collection to Array in Java?  Hello, I have a collection object in data with data in it. How to convert Collection to Array in Java...("This "); Above code create a collection and then add an item to it. Now to convert
How ro convert char into string??
How ro convert char into string??  Suppose i have one array like... char [] ch={'H','E','L','L','o'}; now i want to convert this arrar into string... is for java...but i want this in c# How ro convert char into string using recursive
How to Convert array to list in Java
How to Convert array to list in Java  Hi, I have object of array in Java and I want to convert it to list. How to Convert array to list in Java? (adsbygoogle = window.adsbygoogle || []).push({}); Thanks  
How to convert String to int in Java
How to convert String to int in Java  Hi, I have String with int value in it. I want to know the source code to convert this String value into the int variable. How to convert String to int in Java? Thanks   Hi
How to convert String to int in Java
How to convert String to int in Java  Hi, I have String with int value in it. I want to know the source code to convert this String value into the int variable. How to convert String to int in Java? Thanks   Hi
How to convert String to int in Java
How to convert String to int in Java  Hi, I have String with int value in it. I want to know the source code to convert this String value into the int variable. How to convert String to int in Java? Thanks   Hi
How to convert String to int in Java
How to convert String to int in Java  Hi, I have String with int value in it. I want to know the source code to convert this String value into the int variable. How to convert String to int in Java? Thanks   Hi
How to convert date to string in Java?
How to convert date to string in Java?  Hello developers, I have java.util.Date object and it has to be converted to date format. How to convert date to string in Java? Thanks   Hi, To convert java.util.Date object
How to convert date to time in PHP?
How to convert date to time in PHP?  Hi, programmer. The PHP programming language has several useful functions for getting and manipulating the date and time. The PHP "time()" function is used to get the current Unix timestamp
How to convert map to json in Java
How to convert map to json in Java  Hi, I my program I have an object of HashMap and I have to output this into json string. How to convert map to json in Java? Thanks   Hi, You have to use the Google Gson library
How to convert map to json in Java
How to convert map to json in Java  Hi, I my program I have an object of HashMap and I have to output this into json string. How to convert map to json in Java? Thanks   Hi, You have to use the Google Gson library
How to convert this Java code into GUI?
How to convert this Java code into GUI?   import java.util.Scanner; public class StudentMarks { double totalMarks; String grade; public void setTotalMarks(double totalMarks) { this.totalMarks = totalMarks
How to convert a picture into a shape, convert a picture into a shape, picture shape
How to convert a picture into a shape   ... for that, don't worry. You will learn easily to convert a picture into shape. Take... select the object to convert into shape. I have here a white background picture
How convert a photograph to a painting, convert a photograph to a painting, photograph to a painting
How convert a photograph to a painting       This example will teach you a method to convert... that's  have been given in this example. Picture: Take a picture to convert
How to convert a picture to drawing, convert a picture to drawing, picture to drawing
How to convert a picture to drawing       Learn here a simple processing to make a color picture to drawing, we have tried here to take simple step to learn easily for the beginners

Ads