Loading...

js判斷字母是否為大小寫

Temperature: 0 °C

Mark ChangMark Chang
author_tools

使用JS來判斷字串裡是否含有大寫字母或小寫字母。

//判斷是否含有大寫字母
function chkhascapitalletter(str)
{
var result = str.match(/^.*[A-Z]+.*$/);
if(result==null) return false;
return true;
}

//判斷是否含有小寫字母
function chkhaslowercaseletters(str)
{
var result = str.match(/^.*[a-z]+.*$/);
if(result==null) return false;
return true;
}

以上紀錄~
 

#故事  #判斷字母是否為大小寫  #JS  #javascript  
https://innstory.com/story-js判斷字母是否為大小寫-3001
javascript

Prev
 PHP重新排列陣列中的元素shuffle函數

Next
如何修復Undefined_Index錯誤訊息 

About the Author

Mark Chang

離不開電腦的宅男

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

使用手機將網址分享到 Line時,如何強制使用預設(外部)瀏覽器開啟?

使用手機將網址分享到 Lin...

如標題,當厭惡了每次在line上面分享demo網址給客戶時點選網址就會使用line的瀏覽器開啟。 還...

Android Fragment及Activity 中使用sharedpreferences

Android Fragme...

在Android下想要儲存執行資料的方式有好幾種,例如存在手機空間或者是資料庫空間。 這裡紀錄一下使...

如何修復Undefined Index錯誤訊息

如何修復Undefined ...

錯誤的原因是因為當我們使用 $GET 和 $POST 方法取得變數時會發生這種情況,雖然PHP的部分...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format