I am writing a Go code which reads from a file. To do so I use fmt.Println()
to print into that intermediate file.
How can I print "
?
To print a string in Golang we have to use the package fmt which contains the input/output functions. The correct specifier tells the data type of variable we are printing. The specifiers we can use to print the strings are: %s − By using this we can print the uninterpreted strings or slice.
In your go source files, if you try to use single quotes for a multi-character string literal, you'll get a compiler error similar to illegal rune literal . What you can do instead for removing quotes from the start and end of a string, is use the strings. Trim function to take care of it.
Backtick strings are analogues of any multiline raw string within Python or else Scala: r""" text""" or within JavaScript: String. raw`Hello\u000A!` They are useful: For keeping huge text inside. For regular expressions, while you own many of backslashes.
This is very easy, Just like C.
fmt.Println("\"")
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