In Halunke strings are used to represent all kinds of text including single characters. They are surrounded by double quotes (single quotes are not allowed).

"Foo Bar"

It can answer to the following messages:


Return a reversed version of the String.


("hello" reverse) /* => "olleh" */

replace with

Replace all occurrences of the first string with the second string. You can also provide a Regexp as the first argument. You can then use backreferences in the with String: The entire match can be referenced by \0, the first group by \1 etc,


("ababab" replace "a" with "c") /* => "cbcbcb" */

("ababab" replace (Regexp from "(a)") with "<\1>")
/* => "<a>b<a>b<a>b" */


Find all occurrences of the given Regex. Returns an Array. If it doesn’t include any groups, it contains Strings. If it contains groups, then it contains arrays of strings.

('result = ("aaabaac" scan (Regexp from "a+")))
(result @ 0 else "NOT FOUND") /* => "aaa" */


This matches a Regexp over a String an collects the results in a Dictionary. The entire match is available under the key 0. Every named match can be referenced by its position starting from 1. And all named matches can be referenced by their name and their position.

('regexp = (Regexp from "(?<foo>a+)b(?<bar>c+)"))
('match = ("aaaabcc" match regexp))

(match @ 0 else "NOT FOUND") /* => "aaaabcc" */
(match @ 1 else "NOT FOUND") /* => "aaaa" */
(match @ 2 else "NOT FOUND") /* => "cc" */
(match @ "foo" else "NOT FOUND") /* => "aaaa" */
(match @ "bar" else "NOT FOUND") /* => "cc" */


This compares two strings. It is true, if the two strings are equal. Otherwise, it is false.


("aaa" = "aaa") /* => true */


Concatenate two strings.


("aaa" + "bbb") /* => "aaabbb" */


This returns the string itself.


("aaa" to_s) /* => "aaa" */


This returns a string to represent the string in output. This is done by surrounding it with "


("aaa" inspect) /* => "\"aaa\"" */