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

javascript獲取當前時間

javascript獲取當前...

watchclock var myDate = new Date(); //獲取當前年 var ye...

讓文字左右對齊

讓文字左右對齊

讓文字左右對齊這類的設計案,通常都會出現在平面設計居多。 網頁上很少會遇到客戶會執著於這方面,但不能...

要如何知道ajax執行失敗原因?

要如何知道ajax執行失敗原...

只要在error的function 更改為以下寫法即可: error: function (XMLH...

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