As Zoltan wrote, it's not so easy... especially when you do not provided enough information.
Some usefull examples, you'll find here:
A Simple String Compression Algorithm[
^]
Easy String Compression and Encryption[
^]
Interesting alternative is
SMAZ[
^] - simple compression library suitable for compressing very short strings. It works better with English and it's not general purpose for compressing string data.
You can always use zip, gzip, 7-zip (and other) libraries to compress/decompress data.