/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package de.christofreichardt.jaxws.securitypriceservice;

/**
 *
 * @author Christof Reichardt
 */
public class StringUtil {
  @SuppressWarnings("empty-statement")
  static public String trim(String str) {
    int i, begin, end;
    for (i=0; 
        i<str.length() && Character.isSpaceChar(str.codePointAt(i));
        i++);
    begin = i;
    for (i=str.length() - 1;
        i>=0 && Character.isSpaceChar(str.codePointAt(i));
        i--);
    end = i + 1;
    return str.substring(begin, end);
  }
}
