Created
April 28, 2026 01:56
-
-
Save bg1bgst333/210cbcbf096195aee6e0290c0e412e31 to your computer and use it in GitHub Desktop.
String.startsWith
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // メインクラス | |
| public class MainClass{ | |
| // Javaのエントリポイント | |
| public static void main(String[] arg){ // mainメソッドの定義 | |
| // 文字列strの定義. | |
| String str = "ABXYZCDE"; | |
| // 指定の文字列で始まるか判定. | |
| boolean b = str.startsWith("ABXY"); | |
| // 出力. | |
| System.out.println(b); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment