Rust 程序设计语言 简体中文版 1.85.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.2. match 控制流结构 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 下一环节之前学习每一 个细节,你可能会想要跳过第二章,直接阅读第三章,等到你想要通过项目应用所学到的细节 时再回到第二章。 第五章讨论结构体(struct)和方法,第六章介绍枚举(enum)、match 表达式和 if let 控 制流结构。在 Rust 中,创建自定义类型需要用到结构体和枚举。 第七章介绍 Rust 的模块(module)系统,其中的私有性规则用来组织代码和公开的 API(应 程序设计语言 简体中文版 编写一个猜数字游戏 让我们一起动手完成一个项目来快速上手 Rust!本章将介绍一些 Rust 中常见的概念,并通过 真实的程序来展示如何运用它们。你将会学到 let、match、方法(methods)、关联函数 (associated functions)、外部 crate 等知识!后续章节会深入探讨这些概念的细节。在这一 章,我们将主要练习基础内容。 我们会实现一个0 码力 | 562 页 | 3.23 MB | 29 天前3
 Tornado 6.5 Documentationclosest match based on the supported locales. For example, if the user’s locale is es_GT, and the es locale is supported, self.locale will be es for that request. We fall back on en_US if no close match can in addition to a timestamp and an HMAC signature. If the cookie is old or if the signature doesn’t match, get_signed_cookie will return None just as if the cookie isn’t set. The secure version of the example with every form submission on your site. If the cookie and the value in the form submission do not match, then the request is likely forged. Tornado comes with built-in XSRF protection. To include it in0 码力 | 272 页 | 1.12 MB | 3 月前3
 Tornado 6.5 Documentationclosest match based on the supported locales. For example, if the user’s locale is es_GT, and the es locale is supported, self.locale will be es for that request. We fall back on en_US if no close match can HMAC [http://en.wikipedia.org/wiki/HMAC] signature. If the cookie is old or if the signature doesn’t match, get_signed_cookie will return None just as if the cookie isn’t set. The secure version of the example with every form submission on your site. If the cookie and the value in the form submission do not match, then the request is likely forged. Tornado comes with built-in XSRF protection. To include it in0 码力 | 437 页 | 405.14 KB | 3 月前3
 julia 1.10.10whether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") end If a regular expression does match, the value returned by match is a RegexMatch0 码力 | 1692 页 | 6.34 MB | 3 月前3
 Julia 1.10.9whether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") end If a regular expression does match, the value returned by match is a RegexMatch0 码力 | 1692 页 | 6.34 MB | 3 月前3
 Julia 1.11.4whether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") endCHAPTER 8. STRINGS 64 If a regular expression does match, the value returned0 码力 | 2007 页 | 6.73 MB | 3 月前3
 Julia 1.11.5 Documentationwhether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") endCHAPTER 8. STRINGS 64 If a regular expression does match, the value returned0 码力 | 2007 页 | 6.73 MB | 3 月前3
 Julia 1.11.6 Release Noteswhether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") endCHAPTER 8. STRINGS 64 If a regular expression does match, the value returned0 码力 | 2007 页 | 6.73 MB | 3 月前3
 Julia 1.12.0 RC1whether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") endCHAPTER 8. STRINGS 64 If a regular expression does match, the value returned0 码力 | 2057 页 | 7.44 MB | 3 月前3
 Julia 1.12.0 Beta4whether a match for the given regex occurs in the string. Commonly, however, one wants to know not just whether a string matched, but also how it matched. To capture this information about a match, use the the match function instead: julia> match(r"^\s*(?:#|$)", "not a comment") julia> match(r"^\s*(?:#|$)", "# a comment") RegexMatch("#") If the regular expression does not match the given string, match programmatically: m = match(r"^\s*(?:#|$)", line) if m === nothing println("not a comment") else println("blank or comment") endCHAPTER 8. STRINGS 64 If a regular expression does match, the value returned0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 19 条
- 1
 - 2
 













