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 7862271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:03:52+00:00 2026-06-02T23:03:52+00:00

For ex: I have input with this value: (099) 123 45 67 I want

  • 0

For ex: I have input with this value: (099) 123 45 67
I want to replace the digits with underline (_) on deleting as this: (099) 123 __ __

How I do? I have the function which returns me the current character position. Then with charAt() I get the character and then replace it using replace(). But if there is more than one the same characters it replaces the first one, not the one which next to cursor.
Have any ideas?

  • 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-02T23:03:54+00:00Added an answer on June 2, 2026 at 11:03 pm

    I don’t think the standard replace() function could accomodate this type of replace.

    You’d have to use substring() to split the string into to (one string before the character and one after) and then concatonate them back together with the '_' in between.

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

Sidebar

Related Questions

I have the following script. <input style=color: #ccc type=text value=something name=country onFocus=if (this.value ==
I have an input field with the following value: 12-04-2012 This is a Dutch
Using MATLAB, I have this code: value = input('>> Enter a value: '); and
I have this structure on form, <input type=test value= id=username /> <span class=input-value>John Smith</span>
Ok say you have this: <input id=test value= /> Value of that input is
i have the following code : <input type=text value=<?php echo $_GET['msg']; ?>> This input
I have this HTML code for radios: <input type='radio' name='a_27' value='Yes' id='a_27_0' /> <input
I have this field in one form : <input type=text name=promocode id=promoCode value= style=width:24%
So I have this text input in a form, and I want to update
I have an an ajax request that looks like this, $('input.fakecheck').click(function(){ alert(deleteing....); $.ajax({ url:/search,

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.