Click here to Skip to main content
Rate this: bad
good
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.2K
Comments
Anurag Sinha V at 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 at 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
0 OriginalGriff 7,800
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2014
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