2012-07-23 315 views
0

我有一個字符串,其值爲Sam, Mathews, Perry。我需要知道如何查看字符串中是否存在字符串Perry。我怎樣才能做到這一點;與Extjs進行字符串比較

我的代碼如下,但不幸的是它不工作。我需要幫助來解決這個問題。

var stringNames= "Sam, Mathews, Perry"; 

if (stringNames.contains ('Perry')) { 
// 
console.log('Perry found'); 

} 

回答