In quantum field theory and its extensions including string theory, the electric charge is a generator of a $U(1)$ symmetry which should be promoted to a local symmetry i.e. gauge symmetry.
In string theory, the $U(1)$ symmetry and the gauge field often appear as parts of the low-energy effective action. This could be enough to answer the question: we reduce the problem to the same problem in the approximate theory - quantum field theory.
Except that we don't have to end at this point. String theory produces many geometric pictures how to "imagine" or "visualize" the electric charge. Those "visualizations" are often dual to each other: it means that even though these ways to present the charges superficially look totally different, one may actually demonstrate that their physical implications are totally equivalent and indistinguishable.
Kaluza-Klein theory
The oldest picture embedded in string theory goes back to 1919 and a discovery by Theodor Kaluza, later refined by brilliant physicist Oskar Klein. Five-dimensional general relativity, with the new dimension compactified on a circle, produces $U(1)$ electromagnetism aside from the four-dimensional general relativity.
The mixed components of the metric, $g_{\mu 5}$, may be interpreted as the gauge field $A_\mu$ in the large dimensions. The isometry rotating the circle (compact fifth dimension) at each point is interpreted as the $U(1)$ gauge symmetry. And charged particles are particles that carry a momentum in the new, fifth direction. By quantum mechanics, the momentum has to be quantized (for the wave function to be single-valued), $p=Q/R$, where $R$ is the radius of the circle ($2\pi R$ is the circumference) and $Q$ is an integer that may be identified with the electric charge.
A particle with the opposite charge is simply a particle that moves in the opposite direction along the hidden circular dimension. This works not only for strings but even for point-like particles in higher-dimensional spacetimes.
Windings
String theory offers a special, more intrinsically stringy origin of the charges, too. Closed strings may wrap around a non-contractible loop in spacetime - such as the circle from the Kaluza-Klein theory. They obey boundary conditions on the string:
$$ X^5 (\sigma+\pi) = X^5(\sigma)+2 \pi R w. $$
Those $w$ times wound strings wouldn't exist in a theory without strings. The winding number $w$ - how many times the string is wrapped around the circle - is interpreted as another type of charge. $B_{\mu 5}$, a component of an antisymmetric tensor field, is interpreted as a new gauge field $A_\mu$ for this $U(1)$ symmetry. The oppositely charged particles are strings wrapped in the opposite direction; to be distinct, the closed strings have to be oriented (carry an arrow).
This winding number origin of the charge is equivalent to the Kaluza-Klein origin by an equivalence we call T-duality. The gauge groups in the heterotic string theory combine the Kaluza-Klein-like charges and the winding-like charges and promote them to large non-Abelian groups such as $SO(32)$ or $E_8\times E_8$.
Generalizations of wound strings exist for higher-dimensional branes: the total "wrapping number" of some membranes or branes around non-contractible cycles in spacetime (homology) are also manifesting themselves as electric charges. Many non-perturbative dualities exist. Some cycles on which the branes may be wrapped may be shrunk to zero size but they still exist: in those cases, the charged objects are localized in space (the gauge field only lives on a singularity which may be extended just like a brane). That's the case of the ADE singularities. In all cases, oppositely oriented branes correspond to oppositely charged particles. Note that the orientation may be defined for the "whole world volume" so the reversal of the spatial orientation may be mimicked or compensated by the reversal of the world volume in the temporal dimension.
Open strings and D-branes
When open strings are allowed, they can carry charges (historically known as "Chan-Paton factors") at the end points - these are the points stuck on the D-branes. So the end points behave as quarks: if the string is oriented and carries an arrow from the "beginning" to the "end", the beginning may be called a quark and the end may be called an antiquark. In this setup, the charges are most analogous to those of point-like particles. The world line
of the quark and antiquark (going backwards in time) is nothing else than the boundary of the open world sheet as embedded in the spacetime.
Even this seemingly point-like origin of charges may be dual - exactly equivalent - the purely stringy ways to produce the charges.
This post imported from StackExchange Physics at 2014-04-18 16:15 (UCT), posted by SE-user Luboš Motl