Ruby String directives

Hi guys,

I am newbie to this Forum and new to this language:

I am currently going through the Ruby Array#pack and Array#unpack. But
couldn’t get much more examples of the directives documented in the doc.
So could you help me to understand what are their basic use and also
some examples of the following directives.

String directives :

A and a;M and m; H and h; P and p

Kumar,

Use cases: A good use case is dealing with reading or writing specially
formatted files. For example:

I don’t know about the use of the directives because I haven’t had to
use them in the 8 years I’ve been doing Ruby.

Matt M. wrote in post #1098987:

Kumar,

Use cases: A good use case is dealing with reading or writing specially
formatted files. For example:

BMP file format - Wikipedia

I don’t know about the use of the directives because I haven’t had to
use them in the 8 years I’ve been doing Ruby.

Okay, so according to you, If I skip this topic no matters…right? I am
also facing too much trouble to understand this you know :frowning:

If you’re just starting ruby I’d skip it for now. It doesn’t have a lot
of general use cases. Good luck with ruby!

Sent from my iPhone