Skip to Content
プログラミングRust 第2版
book

プログラミングRust 第2版

by Jim Blandy, Jason Orendorff, Leonora F. S. Tindall, 中田 秀基
January 2022
Intermediate to advanced
680 pages
11h 35m
Japanese
O'Reilly Japan, Inc.
Content preview from プログラミングRust 第2版

17章文字列とテキスト

文字列は飾り気のないデータ構造で、あらゆるところでやり取りされ、処理には重複が多い。情報を隠すにはもってこいだ。

−Alan Perlis, epigram #34†1

[†1] 訳注:Alan Perlisは初期のコンピュータ言語の1つALGOLの作者の一人。第1回のチューリング賞を受賞している。このエピグラムは、1982年にSIGPLANジャーナルに発表した「プログラミングに関する警句集」の1つ。https://en.wikipedia.org/wiki/Epigrams_on_Programming参照。

これまでに、Rustの主要なテキストデータ型String、str、charについて説明してきた。「3.7 文字列型」では、文字と文字列リテラルの構文について説明し、メモリ上での表現についても解説した。本章では、テキストの取り扱いについてさらに詳しく説明する。

本章では、次の項目を取り上げる。

  • 標準ライブラリの設計を理解するために、Unicodeに関する背景知識を説明する。
  • char型について説明する。この型はUnicodeのコードポイント1つを表す。
  • String型とstr型について説明する。これらはそれぞれ、所有されたUnicode文字列と、借用されたUnicode文字列を表す。これらには、多様なメソッドが用意されており、構築、検索、変更、内容のイテレートを行うことができる。
  • Rustの文字列フォーマット機能について説明する。println!マクロやformat!マクロ等だ。フォーマット文字列を用いる独自のマクロを書いて、独自の型をサポートするように拡張することもできる。
  • Rustの正規表現サポートについて概説する。
  • 最後に、Unicodeの正規化がなぜ必要なのかを説明し、Rustで実現する方法を示す。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

プログラミングRust

プログラミングRust

Jim Blandy, Jason Orendorff, 中田 秀基
詳解 システム・パフォーマンス 第2版

詳解 システム・パフォーマンス 第2版

Brendan Gregg, 西脇 靖紘, 長尾 高弘
レガシーコードからの脱却 ―ソフトウェアの寿命を延ばし価値を高める9つのプラクティス

レガシーコードからの脱却 ―ソフトウェアの寿命を延ばし価値を高める9つのプラクティス

David Scott Bernstein, 吉羽 龍太郎, 永瀬 美穂, 原田 騎郎, 有野 雅士

Publisher Resources

ISBN: 9784873119786Other