For actual string formatting, I use the
C++ reference for printf().
For colors (styling, not format), that's more specific to the game. Generally, backslash codes like this don't actually mean anything with respect to the code syntax because the default control character (aka escape character) is the "^". That generally means that if a backslash thing has any meaning, it's probably provided by the function to which you are passing it as opposed to a low-level function like format(). You can look at the documentation for
client_print_color() for how colors are actually done using the control character.
"\n" and "\r" are the new line and carriage return non-printable characters, respectively (that is assuming that the control character is the backslash which is default in languages like C and C++). In AMX Mod X plugins, you would need to use "^n" and "^r" to have them actually act like the new line and carriage return characters. There is a whole bunch of info about what these mean on the internet.
__________________