小编Mat*_*sky的帖子

在Java中使用startsWith和endsWith时如何忽略大小写?

这是我的代码:

public static void rightSel(Scanner scanner,char t)
{
  /*if (!stopping)*/System.out.print(": ");
    if (scanner.hasNextLine())
    {
     String orInput = scanner.nextLine;
        if (orInput.equalsIgnoreCase("help")
        {
            System.out.println("The following commands are available:");
            System.out.println("    'help'      : displays this menu");
            System.out.println("    'stop'      : stops the program");
            System.out.println("    'topleft'   : makes right triangle alligned left and to the top");
            System.out.println("    'topright'  : makes right triangle alligned right and to the top");
            System.out.println("    'botright'  : makes right triangle alligned right and to the bottom");
            System.out.println("    'botleft'   : makes right triangle …
Run Code Online (Sandbox Code Playgroud)

java string startswith case-insensitive ends-with

27
推荐指数
2
解决办法
3万
查看次数

标签 统计

case-insensitive ×1

ends-with ×1

java ×1

startswith ×1

string ×1