JHTP自测题_第十四章_字符串、字符及正则表达式(Strings, Characters and Regular Expressions)
2016-08-08 21:32
471 查看
Self-Review Exercises
14.1State whethereach of the following is
true
or
false. If
false, explain why.
a) When
String
objects arecompared using
==, the result is
true
if the
Strings contain thesame values. (False,String objects are compared using operator == to determine
whether they’re the same object in memory.)
b) A
String
can bemodified after it’s created. (False,String objects are immutable and cannot be modified after they’re created.
StringBuilder objects can be modified after they’re created.)
14.2
For each ofthe following, write a single statement that performs the indicated task:
a) Compare the string in
s1
to the stringin
s2
for equality of contents. (s1.equals(s2))
b) Append the string
s2
to the strings1,
using +=. (s1+=s2)
c) Determine the length of the string in
s1.
(s1.length())
相关文章推荐
- JHTP小结_第十四章_字符串、字符及正则表达式(Strings, Characters and Regular Expressions)
- 三 Swift学习之字符串和字符(Strings and Characters)
- Swift学习之十:字符串与字符(Strings and Characters)
- 2.3 字符串和字符(Strings and Characters)
- swift学习笔记-字符串和字符(Strings and Characters)
- Swift学习笔记 - 教程学习二 字符串和字符(Strings and Characters)
- Swift 字符串和字符(Strings and Characters)
- Swift笔记(二)之字符串与字符(Strings and Characters)
- Swift学习之十:字符串与字符(Strings and Characters)
- Welcome-to-Swift-03字符串和字符(Strings and Characters)
- 正则表达式判断是否存在中文和全角字符和判断包含中文字符串长度
- 贡献一个在匹配字符串前后插入字符的js正则表达式
- @V@ java代码笔记2010-06-12:java控制台输入各类型类实现;以及判断输入字符串里面是否有数字的两种方法:方法1:转换成字符数组;方法2:正则表达式。
- DW 查找某字符串前的所有字符的正则表达式
- java正则表达式匹配字符串字母,数字,空格和其他字符出现次数
- 使用正则表达式计算字符串中中文字符的个数
- 不包含某字符串的字符串匹配 (正则表达式)
- 【正则表达式】Lua字符串去除0字符
- sas9正则表达式测试(对字符串进行字符替换)
- 取以某字符开始,以某字符结束的字符串(正则表达式:VB.net)