java 求模_JAVA字符串截取与求模

public class splitdemo {

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub

String str = "abc,12,3yy98,0";

String [] strs = str.split(",");

for(int i =0,len=strs.length;i

System.out.println(strs[i].toString());

}

String sb = "S201899999999995500";//20位

String sp;

int sp1;

System.out.println(sb.substring(15));

sp = sb.substring(15, 19);

sp1 = Integer.parseInt(sp);

System.out.println("sp1"+"="+sp1);

if (sp1%32 > 17){

System.out.println("调度2库");

}else{

System.out.println("调度1库");

}

String sb1 = "bbbdsajjds";

System.out.println(sb1.substring(2,4));

String sb3 = "S201899999999995500";//20位

System.out.println(sb3.substring(15,19));//从15位截取到19,索引

int x = 5;

int y = 3;

int z;

System.out.println(x%y);

System.out.println(y%x);

System.out.println(5500%32);

System.out.println(32%5500);

int num1 = 19;

double num2 = 6.7;

double result;

result = num1 % num2;

System.out.println(result);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值