1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-02-24 17:42:44 +01:00
This commit is contained in:
Justin Lin 2020-01-26 16:30:27 +08:00
parent b7ad7ea46e
commit 020bf01023
2 changed files with 10 additions and 7 deletions

View File

@ -0,0 +1,5 @@
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

@ -1,15 +1,13 @@
/**
* sub_str.scad
* _sub_str_impl.scad
*
* @copyright Justin Lin, 2017
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib2-sub_str.html
* @see https://openhome.cc/eGossip/OpenSCAD/lib2-_sub_str_impl.html
*
**/
function _sub_str(t, begin, end) =
begin == end ? "" : str(t[begin], sub_str(t, begin + 1, end));
function sub_str(t, begin, end) =
is_undef(end) ? _sub_str(t, begin, len(t)) : _sub_str(t, begin, end);
use <_impl/_sub_str_impl.scad>;
function sub_str(t, begin, end) = _sub_str_impl(t, begin, end);