Java Long Number From toLongitude(String latLng)

Here you can find the source of toLongitude(String latLng)

Description

Method to parse the longitude of a location in the format (<latitude>,<longitude>)

License

Open Source License

Parameter

Parameter Description
latLng a parameter

Declaration

public static double toLongitude(String latLng) 

Method Source Code

//package com.java2s;
/**/*from  www  .j  ava 2 s . com*/
 *    Copyright (C) 2009, 2010 
 *    State of California,
 *    Department of Water Resources.
 *    This file is part of DSM2 Grid Map
 *    The DSM2 Grid Map is free software: 
 *    you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *    DSM2 Grid Map is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details. [http://www.gnu.org/licenses]
 *    
 *    @author Nicky Sandhu
 *    
 */

public class Main {
    /**
     * Method to parse the longitude of a location in the format
     * (&lt;latitude&gt;,&lt;longitude&gt;)
     * 
     * @param latLng
     * @return
     */
    public static double toLongitude(String latLng) {
        String longitude = latLng.substring(latLng.indexOf(",") + 1, latLng.indexOf(")"));
        return Double.parseDouble(longitude);
    }
}

Related

  1. toLongDefaultIfNull(Long configured, long theDefault)
  2. toLongExactWithoutOverflow(float value)
  3. toLongId(Integer i)
  4. toLongInt(byte[] b)
  5. toLongitude(long fsuipcLongitude)
  6. toLongLE(byte target[], int offset, int numBytes, long value)
  7. toLongList(String valus)
  8. toLongMatrix(Number[][] matrix)
  9. toLongMin(double[] in, long[] out)