Reversing a string

In reply to janudeep3:
A much simpler solution is to use the streaming operator ( IEEE 1800-2012 section 11.4.14 Streaming operators (pack/unpack) )

module tb;
string s1 = "string";
string s2;
 
  initial begin
    s2 = {<<8{s1}};
    $display("reversed string=%s", s2);
    end
endmodule