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

在PHP強制顯示錯誤訊息的方法

在PHP強制顯示錯誤訊息的方...

若是單一檔案,只需要在每個PHP檔案裡添加下列行: iniset(&#;displayerrors&...

Android UI設計距離課題

Android UI設計距離...

layoutmarginTop指定該屬性所在控件距離上方的位置空間。 layoutmarginBot...

php定時執行任務ignore_user_abort() 函式

php定時執行任務ignor...

ignoreuserabort() 函式 PHP , PHP 5, 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