【戻る】 【進む】   目次        31. 組み込みクラス - String

文字列(String)

"abc" + "de" #=> "abcde"

str[i, n] # strのi+1番目からn文字 str[i..j] # strのi+1番目からj+1番目の文字列 str[i...j] # strのi+1番目からj番目までの文字列 "abcde"[3 .. 4] #=> "de" "abcde"[3 .. -1] #=> "de" "abcde"[-1, 1] #=> "e" "abcde"[1] #=> 98…"b"のコード
str[i, n] = str0 # str0は文字列 str[i..j] = str0 str[i...j] = str0 str[i] = str0 str[i] = k # kは整数 str[3, 2] = "DE" #=> str == "abcDE" str[3..4] = "DE" #=> str == "abcDE" str[3...4] = "DE" #=> str == "abcDEe" str[3] = "DE" #=> str == "abcDEe" str[3] = 68 #=> str == "abcDe"
"a" < "b" #=> true "a" < "a" #=> false "a" <= "a" #=> true "a" < "A" #=> false "a" < "aa" #=> true
(str = "abc") << "DE" << "f" #=> str == "abcDEf" ((str = "abc").concat("DE")).concat("f") #=> str == "abcDEf"
string string.chomp string.chop "abc" "abc" "ab" "abc\n" "abc" "abc" "abc\r\n" "abc\r" "abc"
"SUBjcect:".downcase #=> "subject:" "SUBjcect:".upcase #=> "SUBJECT:"

【戻る】 【進む】   目次        31. 組み込みクラス - String