As has already been stated in the comments section
- split the string on the symbols
and take the degrees, minutes and
seconds parts individually.
- The degrees and minutes will be integers, the seconds field may have a fractional part and require a floating point input capability. It depends upon your positional accuracy/resolution.
- Calculate the value in degrees DEG + (MIN/60) + (SEC/3600) // Typecasts ignored
- Apply the sign to the result based on the N,S,E,W. By convention N and E are positive, S and W are negative
You will now want to calculate the distance between points which will probably require the conversion of your coordinates from degrees to radians to allow the use of the standard trig libraries.
distance = 2*asin(sqrt((sin((lat1-lat2)/2))^2 +
cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2))