In the short story by O. Henry "A Retrieved Reformation," Jimmy Valentine and Ralph Spencer are one in the same.
Jimmy went to the Planters' Hotel, registered as Ralph D. Spencer, and engaged a room.
Jimmy Valentine is the side of the main character when he first gets out of jail. He is a safe cracker and has a penchant for robbing from banks. The warden liked him and so do most people he meets. He is a charming person. He is well groomed.
Ralph Spence is also charming and a nicely groomed man. He is able to talk with people and verbally manipulate them. However, he falls in love with a banker's daughter and begins to become transformed. He ends up opening a legit business and his shoe store prospers.
The problem that arises is that Jimmy has been found out by someone who blackmails him so he will rob his beloved's father's bank. Jimmy and Ralph have the skills to crack open the safe.
Jimmy Valentine used to wear a rose. After a child gets caught in the safe he gets his wife's rose and puts it on and says good-bye to Ralph Spencer. He has to become Jimmy in order to crack open the safe and expose himself. However, the past closes for him and he gets to stay as Ralph who is a legitimate shore store owner.