“Bananas, when fully ripe, contain soluble fiber and thus can help treat constipation,” Lee says. “However, unripe, or green, bananas have high levels of resistant starch, which can be very binding and cause constipation.” Because of this, unripe bananas can be used to treat diarrhea, she notes.