Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> replaceInString =
- {
- if !(_this isEqualTypeArray ["", "", ""]) exitWith
- {
- "";
- };
- _string = param[0];
- _from = param[1];
- _to = param[2];
- if (_from isEqualTo "") exitWith
- {
- _string;
- };
- _parts = [ ];
- while { true } do
- {
- _find = _string find _from;
- if (_find == -1) exitWith
- {
- _parts pushBack _string;
- };
- _parts pushBack (_string select [0, _find]);
- _string = _string select [_find + count _from];
- };
- _parts joinString _to;
- };
- compileConst =
- {
- _convertToString =
- {
- if (_this isEqualType [ ]) exitWith
- {
- _this apply { _x call _convertToString };
- };
- if (_this isEqualType "") exitWith
- {
- _this splitString '"' joinString '""';
- };
- if (_this isEqualTypeAny [false, 0, { }]) exitWith
- {
- _this;
- };
- "";
- };
- compileFinal str (_this call _convertToString);
- };
- compileFunc =
- {
- if !(_this isEqualType { }) exitWith { };
- _string = str _this;
- compileFinal (_string select [1, count _string - 2]);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement