Hi
It's not clear, from your question, if you want to know how to calculate Standard Deviation from a formula or if you are looking for something more "pragmatic".
If you need a formula from which you can create code, then the formula for Standard Deviation may be found here:
http://mathworld.wolfram.com/StandardDeviation.html
If you are looking for an API, then the Jakarta Commons project has a statistics package, which contains a DescriptiveMaths class, with a getStandardDeviation method:
http://jakarta.apache.org/commons/math/apidocs/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.html
(I've not used the Jakata Commons stats package so can't really comment on its quality or ease of use.)