You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added index and range selection to Texts. "bar"[1] will be "a". Here is an example:
/*
Given a string, return a new string where the first and last chars have been exchanged.
*/
var frontBack = (str: "") {
return if str[0] is str[-1]:
str;
else:
str[-1] & str[1:-1] & str[0];
end;
};
print(frontBack("code")); // eodc
print(frontBack("a")); // a
print(frontBack("ab")); // ba
print(frontBack("abba")); // abba
You can use negative numbers on the second parameter to cycle backward through the text. You can also use negative numbers in regular indices. For example, "bar"[-1] is"r"`.
Arrays are unusable due to a regression.
The text was updated successfully, but these errors were encountered:
[Version: 0.0.2-11-chinchilla]
I added index and range selection to Texts.
"bar"[1]
will be "a". Here is an example:You can use negative numbers on the second parameter to cycle backward through the text. You can also use negative numbers in regular indices. For example,
"bar"[-1] is
"r"`.Arrays are unusable due to a regression.
The text was updated successfully, but these errors were encountered: