Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String stringToAscii(String val) {
        StringBuffer stringBuffer = new StringBuffer();
        char[] chars = val.toCharArray();

        for (int i = 0; i < chars.length; i++) {
            stringBuffer.append((int) chars[i]);
        }

        return stringBuffer.toString();
    }
}