How to print string and int type variable in multiline

Hi guys,

i was doing practice of string and int , printing statement. And i got stuck at this below point.

 string str1="this is test line, which is very long test line"
 $display("%s",str1);

Above line of code will print whole line like : this is test line, which is very long test line

to print this in multiline , i can use substr(i,j) in for loop.

for(int i=0;i<str2.len;i=i+5) begin
							 	
	$display("%-5s",str2.substr(i,i+5));
	i=i+1;		
end

is there any function for integer type variable to print the numbers in multiline?

In reply to Alok_Mandal:

No. But you can convert any number to a string (using $formatf, itoa(), etc), and then do any string manipulation you want.

Passed the int into string queue , and then applied the above method to print it in multiline.
it helped.
thanks,
Alok