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 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 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
Archived
This topic is now archived and is closed to further replies.