Sample code on sending String via UART

hi, I wanna test the UART of Arduino Uno by connecting Rx to Tx ( pin 0 to pin 1)
is there any sample code that can help me to send a string "AT" to Tx and receive that "AT" in Rx in any form (byte, hex...) ?

thanks, actually later I will connect that Tx to another chip and will send ASCII string command ( AT for example)

is there any sample code that can help me to send a string "AT" to Tx and receive that "AT" in Rx in any form (byte, hex...) ?

The serial examples don't care that you have simply connected the TX pin to the RX pin.

receive that "AT" in Rx in any form

Receiving goes via read() only, which returns you a single character from the serial line. ( Or a -1 int, if nothing is available)
It's up to you how to display that char somewhere else.

In Sending, you might use the correponding write function, but there's an additional print(), which recognizes the variable type and converts it to a char stream internally and then sends that.