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 PDO setAttribute

設置屬性 PHP PDO s...

PDO::ATTRCASE:強制列名為指定的大小寫。 PDO::CASELOWER:強制列名小寫。 ...

Ubuntu環境下apache 目錄啟動.htaccess 功能

Ubuntu環境下apach...

.htaccess 檔案是目錄層面的設定檔,可以對目錄變更 Apache 的設定。 要使用 .hta...

在PHP中通過POST發送JSON

在PHP中通過POST發送J...

這回,我遇到需要通過POST請求發送JSON到API。 剛好利用這次的機會紀錄一下: //API U...

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