|Shark stomach eversion|
Good question in that we often hear about sharks that are found with metal cans, licence plates and other non-digestible objects in their stomachs. So what happens when they do consume something that their system cannot process?
Fortunately for sharks, they have the ability to vomit non-digestible objects from their stomach. The process is called stomach eversion and occurs when the shark literally flips their stomach out of their mouths thus ejecting all contents.
As far as a swimsuit, sharks do have a robust digestive system with very strong acids and enzymes so we would assume that it is possible that they would be able to process some types of thin clothing. But with that said, we should note that it is extremely rare that a human is consumed (which would include the person's swimwear) during a shark attack. In the vast majority of cases, the shark will engage in an exploratory bite, discover that the person is not a normal food source, and then swim off to find something typical of its diet.
What's really amazing about the stomach eversion process is how quick it happens. Fortunately for us, the eversion process has been caught on video and we have two of those videos below (the second one shows the process in slow motion):
Photo screenshot from 2nd video.
Video posted on Youtube by Juerg Brunnschweiler and is 31 seconds in length.
Video posted on Youtube by MalibuFrank and is 1:24 in length.