java.lang.String.startsWith()とjava.lang.String.startsWith()のサンプル

サンプルコード
package com.arkgame.study;

public class StartWithDemo {

public static void main(String[] args) {
String cft= “changfatun";

System.out.println(cft.startsWith(“chang", 0));

System.out.println(cft.startsWith(“fatun", 0));

System.out.println(cft.endsWith(“tun"));

}

}

実行結果
true
false
true

Java

Posted by arkgame