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()放法忽略大小写

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料