We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3605cf commit e04cd64Copy full SHA for e04cd64
src/AudioBasic/Str.h
@@ -114,7 +114,7 @@ class Str {
114
this->maxlen = maxlen;
115
this->len = len;
116
this->is_const = isConst;
117
- if (len==0){
+ if (len==0 && !isConst){
118
this->chars[0] = 0;
119
}
120
@@ -610,6 +610,15 @@ class Str {
610
return result;
611
612
613
+ /// Converts the string to an long
614
+ long toLong() {
615
+ long result = 0;
616
+ if (!isEmpty()){
617
+ result = atol(chars);
618
+ }
619
+ return result;
620
621
+
622
/// Converts the string to lowercase letters
623
void toLowerCase(){
624
if (chars!=nullptr){
0 commit comments