I having the problem to Re-Index an Sliced string,
procedure String_Test is
mystr:String:="Hello World";
str:String:=mystr(6 .. 11);
str_re_indexed:String:=Trim(Str, Left); -- it works but whitespace is removed
begin
for K in str_re_indexed'First .. str_re_indexed'Last loop
Put_Line(Integer'Image(K));
end loop;
end String_Test;
After Re-Indexing the string should be (1 ..6)
Is there any predefined Ada function to do that ?
you can define a string subtype for this: