import java.awt.*; import java.util.*; import java.lang.*; import java.text.*; public class strUtil{ static final String newLine = "\n"; static final char charSpace = ' '; static final String strSpace = " "; //Return a copy of a string. public static String strcpy(String string) { int Len; String newStr; char CharStr[]; CharStr = string.toCharArray(); Len = string.length(); newStr = String.copyValueOf(CharStr, 0, Len); return(newStr); } //Return a string copy of at most the first n characters of a string. public static String strncpy(String string, int n) { int Len; String newStr; char CharStr[]; Len = string.length(); if(Len < n)n = Len; CharStr = string.toCharArray(); newStr = String.copyValueOf(CharStr, 0, n); return(newStr); } //Return a string copy of at most m characters of a string, beginning //at index n. public static String strncpy(String string, int n, int m) { int Len; String newStr; char CharStr[]; Len = string.length(); if( (m + n) > Len)m = Len - n; CharStr = string.toCharArray(); newStr = String.copyValueOf(CharStr, n, m); return(newStr); } //Append an integer index to a string. The resulting representation //is made to occupy a field length of Ifield by left-padding with //spaces. public static String indexString(String string, int value, int IField) { int i, Len, delta; String newStr, str1, str2; char CharStr[]; Integer Ivalue = new Integer(value); String strValue = Ivalue.toString(); str1 = string.concat(strValue); Len = str1.length(); if(Len >= IField){ newStr = str1; return(newStr); } delta = IField - Len; CharStr = new char[delta]; for(i=0; i= IField){ newStr = string; return(newStr); } delta = IField - Len; CharStr = new char[delta]; for(i=0; i= IField){ newStr = string; return(newStr); } delta = IField - Len; CharStr = new char[delta]; for(i=0; i