如何在JavaScript中的while循环中进行字符串比较

时间:2018-03-08 17:51:27

标签: javascript

我使用JavaScript while循环填充HTML控件。我需要从总体中排除字符串值。我正在尝试此代码,但它无法正常工作。我在这里做错了什么?

function getWebPropertiesSucceeded()
{
    var user = groupOwnerUsers.getEnumerator();

    while (user.moveNext())
    {
        if (user.get_current().get_title() != 'gps\ims sharepoint site collectors')
        {
            AddRowToTable(user.get_current().get_title());
        }
    } 
}

gps\ims sharepoint site collectors值仍在添加到我的控件中。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:5)

\\启动转义序列,替换为select id, type from ( select row_number() over (partition by type order by id), * from ( select * from my_table where finished_at is null ) s ) s where started_at is null and row_number <= 2; id | type ----+------ 3 | A 6 | B 7 | B 9 | C 10 | C 14 | D (6 rows)