By running printfn "%A" "c"
, I get "c"
.
By running printfn "%s" "c"
, I get c
.
Why the difference? The same goes for char
.
The Print. F# has two basic functions; “printf” and “printfn” to print out the information on console. // Theprintf/printfn functions are similar to the. // Console. Write/WriteLine functions in C#.
We can print the string using %s format specifier in printf function. It will print the string from the given starting address to the null '\0' character. String name itself the starting address of the string. So, if we give string name it will print the entire string.
In java, String format() method returns a formatted string using the given locale, specified format string, and arguments. We can concatenate the strings using this method and at the same time, we can format the output concatenated string. Syntax: There is two types of string format() method.
The %A
specifier tries to hint at object types - the "c"
is it trying to show it is a string. When you do %s
the compiler knows you want to print a string so it doesn't print the quotes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With