bluetooth99 2013-03-29 02:15 采纳率: 0%
浏览 2523

检测用户输入忽略大小写

比较txtOrigintxtDestination 的值,查询变量,假设他们匹配。

           if((origin.getText().toString().matches(queryOrigin))
                    && (destination.getText().toString().matches(queryDestination)))
            {
            //proceed to route found layout
                Intent openRouteFound = new Intent("com.icommute.feu.RouteFound");
                startActivity(openRouteFound);
            }

        /**compares the values of txtOrigin 
        and txtDestination to the query 
        variables assuming it doesn't match*/
            else
            {
            //proceed to no routes found layout
                Intent openNoRoute = new Intent("com.icommute.feu.NoRoute");
                startActivity(openNoRoute);
            }
  • 写回答

1条回答 默认 最新

  • 北边的世界 2013-04-03 04:42
    关注

    使用String.equalsIgnoreCase()放法忽略大小写

    评论

报告相同问题?

悬赏问题

  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?