Re: How can I split a string by a specific substring?

Douglas Gardner <[email protected]> Tue, 23 Apr 2019 20:59:36 +0100
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAPHk0X+91nXW7tRAERmMiDSyALNO_C+qXMzX4W4ZxqSVWgALYQ@mail.gmail.com>
You can split with the / operator.
See: https://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/_backtick_2F.html

Pike v7.8 release 866 running Hilfe v3.5 (Incremental Pike Frontend)
> "!prefix buy 10" / " ";
(1) Result: ({ /* 3 elements */
                "!prefix",
                "buy",
                "10"
            })

Douglas Gardner
[email protected]

On Tue, 23 Apr 2019 at 20:54, MineMoreGames <[email protected]> wrote:
>
> Let’s say I’ve got something like “!prefix buy 10” and I want to split it by a white space so I will get an array : ({“!prefix”, “buy”, “10”})
>
>
>
> How can I achieve this?