Click here to Skip to main content
12,075,066 members (68,013 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Javascript jQuery
Hi,

how to remove the last value (8.55849, 76.87633000000001)* from the input string below using
javascript?



@(8.56197, 76.87608)* (8.56131, 76.87613)* @(8.56131, 76.87613)* (8.56024, 76.87622)* (8.55915, 76.87628000000001)* (8.55849, 76.87633000000001)*

Thanks
Posted 21-Mar-13 0:18am
hasbina1.3K
Comments
Anurag Sinha V 21-Mar-13 5:35am
   
Don't know..somehow the solution has been submitted twice..dnt mind fr that..:)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,

You can use Splice method to remove the last object.
Store your stuff as an array, find the index of the element which you wana delete and use splice method over it.

var arrayMy=[1,2,3,4];
var x=arrayMy.indexOf(4);
arrayMy.Splice(x,1);

hope it helps.

-Anurag
  Permalink  
Comments
hasbina 21-Mar-13 5:37am
   
hmm
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,

You can use Splice method to remove the last object.
Store your stuff as an array, find the index of the element which you wana delete and use splice method over it.

var arrayMy=[1,2,3,4];
var x=arrayMy.indexOf(4);
arrayMy.Splice(x,1);

hope it helps.

-Anurag
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web03 | 2.8.160208.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100