You are currently viewing the gmlscripts.pro static mirror. Forum access and script submissions are not available through this mirror.

Invert gmlscripts.pro

string_split

string_split(str,num,break)
Returns a string with break characters inserted at a given interval.
COPY
  1. /// string_split(str,num,break)
  2. //
  3. // Returns a string with break characters inserted at a given interval.
  4. //
  5. // str text, string
  6. // num number of characters before a break, real
  7. // break characters to insert, string
  8. //
  9. /// gmlscripts.pro/license
  10. {
  11. var str,num,brk,len,i;
  12. str = argument0;
  13. num = argument1;
  14. brk = argument2;
  15. if (num < 1) num = 76;
  16. if (is_real(brk)) brk = "#";
  17. len = string_length(str);
  18. for (i=len-((len-1) mod num); i>num; i-=num) {
  19. str = string_insert(brk,str,i);
  20. }
  21. return str;
  22. }

Contributors: xot

GitHub: View · Commits · Blame · Raw