@@ -155,6 +155,16 @@ Each string object can be transformed into the other two types of objects::
155155If the conversion is not possible for any reason, you'll get an
156156:class: `Symfony\\ Component\\ String\\ Exception\\ InvalidArgumentException `.
157157
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+
158168Methods Related to Length and White Spaces
159169~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160170
@@ -405,12 +415,6 @@ These methods are only available for ``ByteString`` objects::
405415 b('Lorem Ipsum')->isUtf8(); // true
406416 b("\xc3\x28")->isUtf8(); // false
407417
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-
414418Methods Added by CodePointString and UnicodeString
415419~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
416420
0 commit comments