<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/tag/str-utils/feed</link><description>多元化原創文章，內容包羅萬象，有程式語言、網站應用、軟體介紹、硬體介紹、作業系統、旅行遊記、專題採訪、益智問題、文學創作，以及作者們的知識分享和作品分享。</description><language>zh-TW</language><lastBuildDate>Mon, 6 Apr 2026 11:55:06 +0000</lastBuildDate><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>如何使Rust程式語言的starts_with和ends_with方法忽略大小寫？</title><link>https://magiclen.org/str-utils</link><description><![CDATA[    <img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt="">
在開發程式的時候我們時常會需要判斷某個字串的開頭或結尾是否符合某個字串，例如判斷網址是否以「http」或是「https」開頭時，或是判斷檔案名稱是否以「.jpg」或是「.png」結尾時。然而在上述提到的例子中，通訊協定或是檔案副檔名都是可忽略大小寫的，Rust程式語言雖然有提供eq_ignore_ascii_case方法，卻沒有提供starts_with_ignore_ascii_case和end...]]></description><category>Rust</category><category>Rust</category><category>str-utils</category><guid>https://magiclen.org/str-utils</guid><pubDate>Thu, 13 Jun 2019 20:00:47 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>