Click here to Skip to main content
15,884,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
Anurag Sinha V 21-Mar-13 5:35am    
Don't know..somehow the solution has been submitted twice..dnt mind fr that..:)

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.

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


hope it helps.

-Anurag
 
Share this answer
 
Comments
hasbina 21-Mar-13 5:37am    
hmm
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.

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


hope it helps.

-Anurag
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900