util.java

来自「采用JAVA开发」· Java 代码 · 共 54 行

JAVA
54
字号
package com.gctech.sms.voice.common;
import com.gctech.sms.voice.*;
/**
* 工具类
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author lijz@gctech.com.cn
 * @version 1.0
 */
public class Util
{
  private Util()
  {
  }
  public static String randomPassword()
  {
    double d = Math.random();
    return String.valueOf((int)(d*100000));
  }

  public static String getServiceId(int price)
  {
    if(price==100)
    {
      return Config.instance().getServiceId100();
    }
    else if(price==150)
    {
      return Config.instance().getServiceid150();
    }
    else if(price == 200)
    {
      return Config.instance().getServiceId200();
    }
    else
    {
        throw new IllegalArgumentException("传入的价格错误:"+price);
    }
  }

  public static void main(String[] args) {
    String test = ".\\1\\1\\你好,hell.vox";
    test = test.replace('\\','/');
    String t = test.substring(2,test.length()-3);
    t = t+".vox";
//    System.out.println(test);
//    test = test.replaceAll(".\\","/");
//    test = test.replaceAll(".vox","wav");
    System.out.println(t);

  }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?