@@ -145,6 +145,16 @@ Each string object can be transformed into the other two types of objects::
145
145
If the conversion is not possible for any reason, you'll get an
146
146
:class: `Symfony\\ Component\\ String\\ Exception\\ InvalidArgumentException `.
147
147
148
+ There is also a method to get the bytes stored at some position::
149
+
150
+ // ('नमस्ते' bytes = [224, 164, 168, 224, 164, 174, 224, 164, 184,
151
+ // 224, 165, 141, 224, 164, 164, 224, 165, 135])
152
+ b('नमस्ते')->bytesAt(0); // [224]
153
+ u('नमस्ते')->bytesAt(0); // [224, 164, 168]
154
+
155
+ b('नमस्ते')->bytesAt(1); // [168]
156
+ u('नमस्ते')->bytesAt(1); // [224, 164, 184, 224, 165, 141]
157
+
148
158
Methods Related to Length and White Spaces
149
159
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150
160
@@ -367,12 +377,6 @@ These methods are only available for ``ByteString`` objects::
367
377
b('Lorem Ipsum')->isUtf8(); // true
368
378
b("\xc3\x28")->isUtf8(); // false
369
379
370
- // returns the value of the byte stored at the given position
371
- // ('नमस्ते' bytes = [224, 164, 168, 224, 164, 174, 224, 164, 184,
372
- // 224, 165, 141, 224, 164, 164, 224, 165, 135])
373
- b('नमस्ते')->byteCode(0); // 224
374
- b('नमस्ते')->byteCode(17); // 135
375
-
376
380
Methods Added by CodePointString and UnicodeString
377
381
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
378
382
0 commit comments