Answer:
W = F·S vector product of force and distance
Since the string is always perpendicular to the motion of the bob, the string does no work on the pendulum.
The force of gravity does have a component along the motion of the pendulum (except when the displacement is zero) and this force does work
(it is also responsible for the motion of the pendulum)