Forum: Ruby Ruby String directives

Posted by Kumar R. (kumar_r)
on 2013-02-25 20:39
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
Posted by Matt Mongeau (halogenandtoast)
on 2013-02-25 20:50
Kumar,

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

http://en.wikipedia.org/wiki/BMP_file_format#Bitma...

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.
Posted by Kumar R. (kumar_r)
on 2013-02-25 20:55
Matt Mongeau wrote in post #1098987:
> Kumar,
>
> Use cases: A good use case is dealing with reading or writing specially
> formatted files. For example:
>
> http://en.wikipedia.org/wiki/BMP_file_format#Bitma...
>
> 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 :(
Posted by Matt Mongeau (halogenandtoast)
on 2013-02-25 21:13
(Received via mailing list)
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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.