1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00
This commit is contained in:
Justin Lin
2022-03-11 15:08:49 +08:00
parent 5f400c124d
commit fbca4bd868
2 changed files with 6 additions and 8 deletions

View File

@@ -1,5 +0,0 @@
function _sub_str(t, begin, end) =
begin == end ? "" : str(t[begin], _sub_str_impl(t, begin + 1, end));
function _sub_str_impl(t, begin, end) =
is_undef(end) ? _sub_str(t, begin, len(t)) : _sub_str(t, begin, end);

View File

@@ -8,6 +8,9 @@
*
**/
use <_impl/_sub_str_impl.scad>;
function sub_str(t, begin, end) = _sub_str_impl(t, begin, end);
function sub_str(t, begin, end) =
let(
ed = is_undef(end) ? len(t) : end,
cum = [for(i = begin, s = t[i]; i < ed; i = i + 1, s = str(s, t[i])) s]
)
cum[len(cum) - 1];