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 fillStringByBytesOnTail(String strValue, char ch, int iSign) {
        try {
            StringBuffer strTemp = new StringBuffer();
            strTemp.append(strValue);
            int iDifference = iSign - strValue.getBytes().length;
            if (iDifference <= 0)
                return strValue;
            for (int i = 0; i < iDifference; i++)
                strTemp.append(ch);
            return strTemp.toString();
        } catch (Exception ex) {
            return "";
        }
    }
}