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

想在網頁上預覽PDF可使用的方案

想在網頁上預覽PDF可使用的...

使用pdfobject.js #設定顯示位置 <div id="pdf"></d...

PHP查詢陣列中是否存在特定字串in_array() 函數

PHP查詢陣列中是否存在特定...

使用函數inarray() ,適用版本(PHP , PHP 5, PHP , PHP ) 使用方式:...

MySQL:ERROR_1067

MySQL:ERROR_10...

最近安裝了Ubuntu Server .系統。 接著安裝了MySQL 5..的版本。 在時間的預設值...

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