Bobby Pin or even Safety pin will work too.
If you don't have either open your wallet and take out an old laminated card. Insert it between the door and the door frame about where the lock cross bar goes into the door jam. If the curved part is facing you place the flat edge of the card sung against the curved lock bar and pull the door knob towards you as you are pushing the card snug. The door will open.
If the curved lock bar is facing away from you use the corner of the card to tickle the top or bottom back edge of the lock cross bar. This might mean bending the card slightly. Again you are trying to release the lock bar by applying pressure on the curved edge that goes into the door jam. After a few seconds when you feel the corner edge of the card is snug against the lock cross beam, again apply pressure to the doorknob pushing it away from you and pulling it towards you as you press on the card. After you get the card in the right spot when you pull the door towards you you should feel the cross bar give and the door will swing open.
This also works for outside door locks with more substantial locks. Just not deadbolts.