标签:
what is different between %s and %0s?(%s和%零s)
%s prints the string as it is with spaces at the begining if string contents
are less than string variable size.
whereas %0s supress printing spaces.
(如果字符串的内容小于字符串变量的尺寸,%s打印字符串时前面会添加空格;而%0s不会添加空格(字符串顶头打印))
Here is an example. Hope this helps!
module test(); reg [10*8:0] str = "hello"; initial begin $display("%s", str); $display("%0s", str); end endmodule // test
标签:
原文地址:http://www.cnblogs.com/hfyfpga/p/4316262.html