@@ -155,6 +155,16 @@ Each string object can be transformed into the other two types of objects::
155
155
If the conversion is not possible for any reason, you'll get an
156
156
:class: `Symfony\\ Component\\ String\\ Exception\\ InvalidArgumentException `.
157
157
158
+ There is also a method to get the bytes stored at some position::
159
+
160
+ // ('नमस्ते' bytes = [224, 164, 168, 224, 164, 174, 224, 164, 184,
161
+ // 224, 165, 141, 224, 164, 164, 224, 165, 135])
162
+ b('नमस्ते')->bytesAt(0); // [224]
163
+ u('नमस्ते')->bytesAt(0); // [224, 164, 168]
164
+
165
+ b('नमस्ते')->bytesAt(1); // [168]
166
+ u('नमस्ते')->bytesAt(1); // [224, 164, 184, 224, 165, 141]
167
+
158
168
Methods Related to Length and White Spaces
159
169
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160
170
@@ -405,12 +415,6 @@ These methods are only available for ``ByteString`` objects::
405
415
b('Lorem Ipsum')->isUtf8(); // true
406
416
b("\xc3\x28")->isUtf8(); // false
407
417
408
- // returns the value of the byte stored at the given position
409
- // ('नमस्ते' bytes = [224, 164, 168, 224, 164, 174, 224, 164, 184,
410
- // 224, 165, 141, 224, 164, 164, 224, 165, 135])
411
- b('नमस्ते')->byteCode(0); // 224
412
- b('नमस्ते')->byteCode(17); // 135
413
-
414
418
Methods Added by CodePointString and UnicodeString
415
419
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
416
420
0 commit comments