@@ -101,8 +101,8 @@ namespace NectarCore
101101type = NectarCore::Enum::Type::String;
102102data.ptr =new NectarCore::Class::String (_value);
103103}
104-
105- VAR::VAR (std::string _value)
104+
105+ VAR::VAR (const std::string _value)
106106{
107107type = NectarCore::Enum::Type::String;
108108data.ptr =new NectarCore::Class::String (_value);
@@ -113,6 +113,12 @@ namespace NectarCore
113113type = NectarCore::Enum::Type::String;
114114data.ptr =new NectarCore::Class::String (_value);
115115}
116+
117+ VAR::VAR (std::string_view _value)
118+ {
119+ type = NectarCore::Enum::Type::String;
120+ data.ptr =new NectarCore::Class::String ({_value.data (), _value.size ()});
121+ }
116122
117123VAR::VAR (NectarCore::Class::FixedArray *_value)
118124{
@@ -592,6 +598,18 @@ namespace NectarCore
592598else if (type == NectarCore::Enum::Type::Boolean || type == NectarCore::Enum::Type::Number)return data.number ;
593599else return (bool )(*(NectarCore::Class::Base*)data.ptr );
594600}
601+
602+ VAR::operator const char *()const
603+ {
604+ if (type == NectarCore::Enum::Type::String)
605+ {
606+ return ((NectarCore::Class::String*)this ->data .ptr )->value .c_str ();
607+ }
608+ else
609+ {
610+ throw (NectarCore::VAR (" Char* conversion error: variable is not a string" ));
611+ }
612+ }
595613
596614VAR::operator std::string ()const
597615{
@@ -617,5 +635,17 @@ namespace NectarCore
617635return (long long )((double )*this );
618636}
619637
638+ VAR::operator std::string_view ()const
639+ {
640+ if (type == NectarCore::Enum::Type::String)
641+ {
642+ return std::string_view (((NectarCore::Class::String*)this ->data .ptr )->value .c_str ());
643+ }
644+ else
645+ {
646+ throw (NectarCore::VAR (" string_view conversion error: variable is not a string" ));
647+ }
648+ }
649+
620650
621651}// namespace NectarCore