Unispaces
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FFriZz

//@version=5

// @description Easier than looking up unicode spaces
library("Unispaces",overlay=true)


// @function **UNISPACES**  
// **Params** 
// - `sequence - (int) required | 0 = normal " "`
// - `string1 - (str) optional | default = ""`
// - `string2 - (str) optional | default = ""`  
//***
//**Info** 
// - leaving `string1` or `string2` blank the function will still add unicode spaces placing them
//at the front if only `sting2` is used or at the back if only `string1` is used
// - Only 0-9 options compared to `space()'s` 15 options should still be able to get
//the perfect space   
//***
// @param sequence (int) required | 123 = 3 spaces / 3 different sizes (one space per number can find spaces in hover over)
// @param string1 (str) optional | default = ""    
// @param string2 (str) optional | default = ""
// @returns `string - concatenated string surrounding unispaces`
//***
//Num|‖ Example |‖ Name/Link
//|-|-|-|
//|---------|--------------|----------------------------|
//1.|‖ foo﻿bar |‖ -- [zero width no-break space](https://unicode-explorer.com/c/feff) 
//2.|‖ foo​bar   |‖ -- [zero width space](https://unicode-explorer.com/c/200) 
//3.|‖ foo bar  |‖ -- [hair space](https://unicode-explorer.com/c/200a) 
//4.|‖ foo bar  |‖ -- [narrow no-break space](https://unicode-explorer.com/c/202f) 
//5.|‖ foo bar  |‖ -- [six-per-em space](https://unicode-explorer.com/c/2006) 
//6.|‖ foo bar  |‖ -- [thin space](https://unicode-explorer.com/c/2009) 
//7.|‖ foo bar  |‖ -- [figure space](https://unicode-explorer.com/c/2007) 
//8.|‖ foo bar  |‖ -- [em space](https://unicode-explorer.com/c/2003) 
//9.|‖ foo　bar |‖ -- [ideographic space](https://unicode-explorer.com/c/3000) 
//***
//**Examples** 
// ```
// import FFriZz/Unispaces/1 as uni
// seq = 4552
// string1 = "foo"
// string2 = "bar"
// wspaces = uni.spaces(seq,string1,string2)  
////out
// wspaces = "foo​   bar"
//```
//***
//**Function**
//```
//| uni.spaces(int sequence, string string1 = '', string string2 = '') =>
//|     get = ""
//|     spaces = array.from(" ","﻿","​"," "," "," "," "," "," "," ")
//|     to_str = str.split(str.tostring(sequence), '')
//|     for i in to_str
//|         get += spaces.get(int(str.tonumber(i)))
//|     out = string1+get+string2
//|
//| - "@FFriZz"
//```
export method spaces(int sequence, string string1 = '', string string2 = '') =>
	get = ""
	spaces = array.from(" ","﻿","​"," "," "," "," "," "," "," ")
	to_str = str.split(str.tostring(sequence), '')
	for i in to_str
		get += spaces.get(int(str.tonumber(i)))
	out = string1+get+string2



// @function **UNISPACE**
//***
// **Params** 
// - `space - (int) optional | default = 0 (0 = normal " ")`
// - `string1 - (str) optional | default = ""`
// - `string2 - (str) optional | default = ""`  
//***
//**Info**  
// - leaving `string1` or `string2` blank function will still add unicode space placing it
//at the front if only `sting2` is used or at the back if only `string1` is used
//***
// @param space (int) optional | default = 0 | 0-15 (can find spaces in hover over)      
// @param string1 (str) optional | default = ""
// @param string2 (str) optional | default = ""
// @returns `string - concatenated string surrounding a unispace `
//***
//Num|‖ Example |‖ Name/Link
//|-|-|-|
//|---------|--------------|----------------------------|
//1.|‖ foo﻿bar |‖ -- [zero width no-break space](https://unicode-explorer.com/c/feff) 
//2.|‖ foo​bar   |‖ -- [zero width space](https://unicode-explorer.com/c/200) 
//3.|‖ foo bar  |‖ -- [hair space](https://unicode-explorer.com/c/200a) 
//4.|‖ foo bar  |‖ -- [narrow no-break space](https://unicode-explorer.com/c/202f) 
//5.|‖ foo bar  |‖ -- [six-per-em space](https://unicode-explorer.com/c/2006) 
//6.|‖ foo bar  |‖ -- [thin space](https://unicode-explorer.com/c/2009) 
//7.|‖ foo bar  |‖ -- [punctuation space](https://unicode-explorer.com/c/2008) 
//8.|‖ foo bar  |‖ -- [medium mathematical space](https://unicode-explorer.com/c/205f) 
//9.|‖ foo bar  |‖ -- [four-per-em space](https://unicode-explorer.com/c/2005) 
//10.|‖ foo bar  |‖ -- [no-break space](https://unicode-explorer.com/c/00a0) 
//11.|‖ foo bar  |‖ -- [three-per-em space](https://unicode-explorer.com/c/2004) 
//12.|‖ foo bar  |‖ -- [en space](https://unicode-explorer.com/c/2002) 
//13.|‖ foo bar  |‖ -- [figure space](https://unicode-explorer.com/c/2007) 
//14.|‖ foo bar  |‖ -- [em space](https://unicode-explorer.com/c/2003) 
//15.|‖ foo　bar |‖ -- [ideographic space](https://unicode-explorer.com/c/3000) 
//***
//**Examples** 
// ```
// import FFriZz/Unispaces/1 as uni
// string1 = "foo"
// string2 = "bar"
// str1 = uni.space(string1,2,string2)  
// str1 = uni.space(string1,14,string2) 
////out
// str1 = "foo bar"
// str2 = "foo﻿bar"
//```
//***
//**Function**
//```
//| uni.space(int space = 0, string string1 = '', string string2 = '') =>
//|     spaces = array.from(" ","﻿","​"," "," "," "," "," "," "," "," "," "," "," "," ")
//|     out = string1+spaces.get(space)+string2
//| 
//| - "@FFriZz"
//```
export method space(int space = 0, string string1 = '',  string string2 = '') =>
	spaces = array.from(" ","﻿","​"," "," "," "," "," "," "," "," "," "," "," "," ")
	out = string1+spaces.get(space)+string2



// Examples - Usage
// import FFriZz/FrizBug/11 as p
// p.print(space(12,'foo','bar'),"test2", pos = '6')
// p.print(spaces(455245462,'foo','bar'),"test1",pos = '3')


// @function **repeat()**  
//**Examples** 
// ```
// import FFriZz/Unispaces/2 as uni
// re = uni.repeat("ABC", 10)  
////out
////re = "ABCABCABCABCABCABCABCABCABCABC"
//```
//***
//**Function**
//```
//| export method repeat(string to_repeat,int count) =>
//|     build = ""
//|	    for i = 0 to count
//|		    build += to_repeat
//|	    build
//|
//| - "@FFriZz"
//```
// **Params**  
//***
//**Info** 
// - repeat a given string by the count provided
//***
// @param to_repeat (str) required | "ABC"
// @param count (str) required |     
// @returns `string - string of repeated strings`
//***
export method repeat(string to_repeat,int count) =>
	build = ""
	for i = 0 to count
		build += to_repeat
	build


























