Grey Syntax Posted July 21, 2009 Share Posted July 21, 2009 Hey, Im in need of a equivalent to PHP's char(int) or C#'s (cSharp) Convert.toChar(int) method in java, simply it needs to be able to work in the same way. I am aware i can do byte[] char1 = { 1 }; and cast/convert it to a String but this is inconvenient as my program has to use multiple chars frequently. Any help is welcome'd. -Grey Quote Link to comment https://forums.phpfreaks.com/topic/166795-solved-java-equivalent-of-converttocharint-csharp-or-charint-php/ Share on other sites More sharing options...
Grey Syntax Posted July 21, 2009 Author Share Posted July 21, 2009 Found my answer, package com.hailstorm.message; public class Char { public static int decodeChar (char c) { return ((int) c); } public static char encodeChar (int i) { return ((char) i); } } Can some one please close the thread Quote Link to comment https://forums.phpfreaks.com/topic/166795-solved-java-equivalent-of-converttocharint-csharp-or-charint-php/#findComment-879663 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.