Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8252361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:32:40+00:00 2026-06-08T00:32:40+00:00

How can i remove from a string between two indexOf i have this jsFiddle

  • 0

How can i remove from a string between two indexOf

i have this jsFiddle

here is my code :

 var x = "M 178.6491699876038 23.419570090792845 C 183.6491699876038 
23.419570090792845 186.47776067057902 30.902823043098138 190.3670728596699 
     41.19229585251793 L 194.25638504876076 51.48176866193772" ; 
  var c = x.indexOf('C') ; 
  var L = x.indexOf('L') ;
  var final = x.slice (c,L) ;
  console.log(final) ;

this code will result in returning the removed part of the string

QUESTION how can i return the original string after removing the part between C and L

​

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:32:41+00:00Added an answer on June 8, 2026 at 12:32 am

    Just replace that part of the original string with nothing :

    var x = "M 178.6491699876038 23.419570090792845 C 183.6491699876038 23.419570090792845 186.47776067057902 30.902823043098138 190.3670728596699 41.19229585251793 L 194.25638504876076 51.48176866193772" ; 
    var c = x.indexOf('C') ; 
    var L = x.indexOf('L') ;
    
    var final = x.slice (c,L) ;
    console.log(x.replace(final, ''));
    

    FIDDLE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i remove $_SERVER['DOCUMENT_ROOT'] from a string like this /home/bla/test/pic/photo.jpg the result should
How can I remove duplicate characters from a string using Python? For example, let's
How can I remove text from between square brackets and the brackets themselves? For
How would I remove a view from this dialog? I know I can remove
I have tried to delete an item from a string divided with commas: var
How can I remove entries from a list of strings starting from nth position?
we can remove formula from one cell by cell.setCellFormula(null) . but if i want
How to I can remove posts from a specific category from homepages in wordpress?
According to Best way to remove from NSMutableArray while iterating? , we can't remove
I want to know is there any way that I can remove duplicates from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.