I have an object ex: string str
and I want to make it read-only after it changed its value twice as shown here
string str="hello world";
str="hello";
str="hi";
//good
str="sup";
//error
but I also want to be able to change the number of times value can be assigned to the object for example:
string str[limit 2]="hello world";
str="hello";
str="hi";
//good
str[limit++];
str="sup";
//good
is it possible?