在字符串中查找文本,不区分大小写

时间:2016-08-08 10:48:43

标签: google-apps-script google-sheets

我制作了一个小脚本来检查我的费用。在描述中我寻找一个术语。所以我在一个字符串中搜索(比如超市品牌)。不幸的是,它只能检查区分大小写。如何解决这个问题?我想在独立于案例的字符串中搜索。搜索条件可以是小写的上限,易于调整。

if ((int)response.StatusCode == 302) // redirect
{
    /*
        Call the function recursively with the new URL, found in
        response.Headers["Location"], in my case this would be:
    */

    auth_url_internal = response.Headers["Location"];
    return PerformLogin(username, password);
}

1 个答案:

答案 0 :(得分:2)

只需替换它:

data[n][3].toString().toUpperCase()===uitgaven[i][0].toUpperCase()

为此:

data[n][3].toString().match(uitgaven[i][0])==uitgaven[i][0]
相关问题