Skip to content

Commit 08cb15e

Browse files
committed
String docs indentation added
1 parent a54f6a3 commit 08cb15e

File tree

1 file changed

+66
-66
lines changed

1 file changed

+66
-66
lines changed

README.md

+66-66
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
99
<script src="https://raw.githubusercontent.com/the-ruby-js-project/rubyinjs/master/lib/ruby.js"></script>
1010

1111
<script>
12-
"1234".to_i() // 1234
13-
"1234.35".to_f() // 1234.35
14-
"shiva bhusal".start_with_('shi') // true
15-
"shiva bhusal".start_with_('hi') // false
12+
"1234".to_i() // 1234
13+
"1234.35".to_f() // 1234.35
14+
"shiva bhusal".start_with_('shi') // true
15+
"shiva bhusal".start_with_('hi') // false
1616
</script>
1717

1818
```
@@ -23,21 +23,21 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
2323

2424
#### *(n)
2525
```js
26-
"Ho! ".x(3) //=> "Ho! Ho! Ho! "
26+
"Ho! ".x(3) //=> "Ho! Ho! Ho! "
2727
```
2828

2929
#### capitalize
3030
```js
31-
"hello".capitalize() //=> "Hello"
31+
"hello".capitalize() //=> "Hello"
3232
```
3333

3434
#### casecmp?(str)
3535

3636
```js
37-
"abcdef".casecmp_("abcde") //=> false
38-
"aBcDeF".casecmp_("abcdef") //=> true
39-
"abcdef".casecmp_("abcdefg") //=> false
40-
"abcdef".casecmp_("ABCDEF") //=> true
37+
"abcdef".casecmp_("abcde") //=> false
38+
"aBcDeF".casecmp_("abcdef") //=> true
39+
"abcdef".casecmp_("abcdefg") //=> false
40+
"abcdef".casecmp_("ABCDEF") //=> true
4141

4242

4343
```
@@ -46,28 +46,28 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
4646

4747
```js
4848

49-
"hello".center(4) //=> "hello"
50-
"hello".center(20) //=> " hello "
51-
"hello".center(20, '123') //=> "1231231hello12312312"
49+
"hello".center(4) //=> "hello"
50+
"hello".center(20) //=> " hello "
51+
"hello".center(20, '123') //=> "1231231hello12312312"
5252
```
5353

5454
#### chr
5555

5656
```js
57-
"abcde".chr() //=> "a"
57+
"abcde".chr() //=> "a"
5858
```
5959

6060
#### downcase
6161

6262
```js
6363

64-
"hEllO".downcase() //=> "hello"
64+
"hEllO".downcase() //=> "hello"
6565
```
6666

6767
#### upcase
6868

6969
```js
70-
"hEllO".upcase() //=> "HELLO"
70+
"hEllO".upcase() //=> "HELLO"
7171
```
7272

7373
#### each_char {}
@@ -85,9 +85,9 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
8585

8686
```js
8787

88-
"hello".empty_ //=> false
89-
" ".empty _ //=> false
90-
"".empty_ //=> true
88+
"hello".empty_ //=> false
89+
" ".empty _ //=> false
90+
"".empty_ //=> true
9191
```
9292

9393
#### end_with?(str)
@@ -107,87 +107,87 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
107107
```js
108108

109109

110-
"hello".gsub(/[aeiou]/, '*') //=> "h*ll*"
111-
"hello".gsub(/([aeiou])/, '<\1>') //=> "h<e>ll<o>"
110+
"hello".gsub(/[aeiou]/, '*') //=> "h*ll*"
111+
"hello".gsub(/([aeiou])/, '<\1>') //=> "h<e>ll<o>"
112112
```
113113

114114
#### include?(str)
115115

116116
```js
117117

118-
"hello".include_("lo") //=> true
119-
"hello".include_("ol") //=> false
120-
"hello".include_('h') //=> true
118+
"hello".include_("lo") //=> true
119+
"hello".include_("ol") //=> false
120+
"hello".include_('h') //=> true
121121
```
122122

123123
#### index
124124

125125
```js
126126

127-
"hello".index('e') //=> 1
128-
"hello".index('lo') //=> 3
129-
"hello".index('a') //=> nil
130-
"hello".index('e') //=> 1
127+
"hello".index('e') //=> 1
128+
"hello".index('lo') //=> 3
129+
"hello".index('a') //=> nil
130+
"hello".index('e') //=> 1
131131
```
132132

133133
#### lines
134134

135135
```js
136136

137-
"hello\nworld\n".lines() //=> ["hello\n", "world\n"]
138-
"hello world".lines(' ') //=> ["hello ", " ", "world"]
139-
"hello\nworld\n".lines() //=> ["hello", "world"]
137+
"hello\nworld\n".lines() //=> ["hello\n", "world\n"]
138+
"hello world".lines(' ') //=> ["hello ", " ", "world"]
139+
"hello\nworld\n".lines() //=> ["hello", "world"]
140140
```
141141

142142
#### lstrip
143143

144144
```js
145145

146-
" hello ".lstrip() //=> "hello "
147-
"hello".lstrip() //=> "hello"
146+
" hello ".lstrip() //=> "hello "
147+
"hello".lstrip() //=> "hello"
148148
```
149149

150150
#### rstrip
151151

152152
```js
153153

154-
" hello ".rstrip() //=> " hello"
155-
"hello".rstrip() //=> "hello"
154+
" hello ".rstrip() //=> " hello"
155+
"hello".rstrip() //=> "hello"
156156
```
157157

158158
#### match?(regex)
159159

160160
```js
161161

162162

163-
"Ruby".match_(/R.../) //=> true
164-
"Ruby".match_(/R.../, 1) //=> false
165-
"Ruby".match_(/P.../) //=> false
163+
"Ruby".match_(/R.../) //=> true
164+
"Ruby".match_(/R.../, 1) //=> false
165+
"Ruby".match_(/P.../) //=> false
166166
```
167167

168168
#### succ
169169

170170
```js
171171

172-
"abcd".succ() //=> "abce"
173-
"THX1138".succ() //=> "THX1139"
172+
"abcd".succ() //=> "abce"
173+
"THX1138".succ() //=> "THX1139"
174174
"<<koala>>".succ()
175175
```
176176

177177
#### next
178178

179179
```js
180180

181-
"abcd".next() //=> "abce"
182-
"THX1138".next() //=> "THX1139"
183-
"<<koala>>".next() //=> "<<koalb>>"
181+
"abcd".next() //=> "abce"
182+
"THX1138".next() //=> "THX1139"
183+
"<<koala>>".next() //=> "<<koalb>>"
184184
```
185185

186186
#### ord
187187

188188
```js
189189

190-
"a".ord() //=> 49
190+
"a".ord() //=> 49
191191
```
192192

193193
#### prepend
@@ -196,26 +196,26 @@ methods like `match?` or `include?`, `empty?` use `_` instead of `?`.
196196

197197
// Non mutative
198198
a = "!"
199-
a.prepend("hello ", "world") //=> "hello world!"
200-
a.prepend("hello ", "world", 'shiva') //=> "hello world shiva!"
199+
a.prepend("hello ", "world") //=> "hello world!"
200+
a.prepend("hello ", "world", 'shiva') //=> "hello world shiva!"
201201
```
202202

203203
#### reverse
204204

205205
```js
206206

207-
"stressed".reverse() //=> "desserts"
207+
"stressed".reverse() //=> "desserts"
208208
```
209209

210210
#### scan(pattern)
211211

212212
```js
213213

214214
a = "cruel world"
215-
a.scan(/\w+/) //=> ["cruel", "world"]
216-
a.scan(/.../) //=> ["cru", "el ", "wor"]
217-
a.scan(/(...)/) //=> [["cru"], ["el "], ["wor"]]
218-
a.scan(/(..)(..)/) //=> [["cr", "ue"], ["l ", "wo"]]
215+
a.scan(/\w+/) //=> ["cruel", "world"]
216+
a.scan(/.../) //=> ["cru", "el ", "wor"]
217+
a.scan(/(...)/) //=> [["cru"], ["el "], ["wor"]]
218+
a.scan(/(..)(..)/) //=> [["cr", "ue"], ["l ", "wo"]]
219219
```
220220

221221
#### size
@@ -239,39 +239,39 @@ a.scan(/(..)(..)/) //=> [["cr", "ue"], ["l ", "wo"]]
239239

240240
```js
241241

242-
"hello".sub(/[aeiou]/, '*') //=> "h*llo"
242+
"hello".sub(/[aeiou]/, '*') //=> "h*llo"
243243
```
244244

245245
#### swapcase
246246

247247
```js
248248

249-
"Hello".swapcase() //=> "hELLO"
250-
"cYbEr_PuNk11".swapcase() //=> "CyBeR_pUnK11"
249+
"Hello".swapcase() //=> "hELLO"
250+
"cYbEr_PuNk11".swapcase() //=> "CyBeR_pUnK11"
251251
```
252252

253253
#### to_f
254254

255255
```js
256256

257-
"123.45e1".to_f() //=> 1234.5
258-
"45.67 degrees".to_f() //=> 45.67
259-
"thx1138".to_f() //=> 0.0
257+
"123.45e1".to_f() //=> 1234.5
258+
"45.67 degrees".to_f() //=> 45.67
259+
"thx1138".to_f() //=> 0.0
260260
```
261261

262262
#### to_i
263263

264264
```js
265265

266-
"12345".to_i() //=> 12345
267-
"99 red balloons".to_i() //=> 99
268-
"0a".to_i() //=> 0
269-
"0a".to_i(16) //=> 10
270-
"hello".to_i() //=> 0
271-
"1100101".to_i(2) //=> 101
272-
"1100101".to_i(8) //=> 294977
273-
"1100101".to_i(10) //=> 1100101
274-
"1100101".to_i(16) //=> 17826049
266+
"12345".to_i() //=> 12345
267+
"99 red balloons".to_i() //=> 99
268+
"0a".to_i() //=> 0
269+
"0a".to_i(16) //=> 10
270+
"hello".to_i() //=> 0
271+
"1100101".to_i(2) //=> 101
272+
"1100101".to_i(8) //=> 294977
273+
"1100101".to_i(10) //=> 1100101
274+
"1100101".to_i(16) //=> 17826049
275275

276276
```
277277

0 commit comments

Comments
 (0)