All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.chen0040.svmext.utils.StringUtils Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package com.github.chen0040.svmext.utils;


import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.math.BigInteger;


/**
 * Created by xschen on 1/5/2017.
 */
public class StringUtils {
   public static double parseDouble(String text) {
      try {
         return Double.parseDouble(text);
      } catch(NumberFormatException ex) {
         return 0;
      }
   }

   public static String stripQuote(String sentence){
      if(sentence.startsWith("\"") && sentence.endsWith("\"")){
         return sentence.substring(1, sentence.length()-1);
      }
      return sentence;
   }


   public static boolean isEmpty(String line) {
      return line == null || line.equals("");
   }



}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy