Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Transform the raw ASCIIs to String by its value. "," is the separator.
     * 
     * e.g. if ASCIIs = "97", the result is "a". if ASCIIs = "97,98", the result is "ab".
     * 
     * @param ASCIIs the raw ASCIIs require transforming
     * @return the String by its value
     */
    public static String asciis2String(String ASCIIs) {
        String[] ASCIIss = ASCIIs.split(",");
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < ASCIIss.length; i++) {
            sb.append((char) __ascii2Char(Integer.parseInt(ASCIIss[i])));
        }
        return sb.toString();
    }

    private static char __ascii2Char(int ASCII) {
        return (char) ASCII;
    }
}