The MID() function in Salesforce returns a set number of characters from the middle of a text value, starting at a position you choose: MID("Salesforce", 6, 5) returns “force”. Combined with FIND(), it extracts text between two markers, such as the domain of an email address or the code after a “#”.
Most MID tutorials show only the basic syntax. Here I also tested the edge cases in a Salesforce Developer Edition org, including what happens when the start position is beyond the end of the text, and collected the MID + FIND patterns you will actually use.