2 bluetooth99 bluetooth99 于 2013.03.29 10:15 提问

检测用户输入忽略大小写

比较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个回答

u010122579
u010122579   2013.04.03 12:42

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

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!