第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

測(cè)試的時(shí)候遇到一個(gè)問(wèn)題: <c:out value="${fn:endsWith('helle','e') }"></c:out> <c:out value="${fn:endsWith('hhlle','e') }"></c:out> 訪問(wèn)的時(shí)候顯示 false true 。 為什么啊?。????

測(cè)試的時(shí)候遇到一個(gè)問(wèn)題:
<c:out value="${fn:endsWith('helle','e') }"></c:out>
<c:out value="${fn:endsWith('hhlle','e') }"></c:out>
訪問(wèn)的時(shí)候顯示 false true 。 為什么啊??????

正在回答

1 回答

public?static?boolean?endsWith(String?input,?String?substring)
????{
????????if?(input?==?null)
????????????input?=?"";
????????if?(substring?==?null)
????????????substring?=?"";
????????int?index?=?input.indexOf(substring);//此處應(yīng)該是lastIndexOf
????????if?(index?==?-1)
????????????return?false;
????????if?(index?==?0?&&?substring.length()?==?0)
????????????return?true;
????????return?(index?==?input.length()?-?substring.length());}

以上是JSTL的endsWith的源碼,可以看出存在一些bug

http://stackoverflow.com/questions/16750540/jstl-bug-in-function-endswith

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

夢(mèng)影劍魂 提問(wèn)者

封裝好的源碼也有bug啊,謝謝啦
2016-10-28 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

測(cè)試的時(shí)候遇到一個(gè)問(wèn)題: <c:out value="${fn:endsWith('helle','e') }"></c:out> <c:out value="${fn:endsWith('hhlle','e') }"></c:out> 訪問(wèn)的時(shí)候顯示 false true 。 為什么啊?。????

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)