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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:15:01+00:00 2026-06-10T10:15:01+00:00

I have 2 questions: Suppose if i have a string Have a nice day

  • 0

I have 2 questions:

  1. Suppose if i have a string "Have a nice day"
    this is the output I want: " " (15 spaces)

  2. Also how do you create a string dynamically in javascript
    For eg: in ruby

    "A"*10
    "AAAAAAAAAA"

If the latter is possible I could have done the first one ( something like this. ) " "*(input.length)

  • 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-10T10:15:02+00:00Added an answer on June 10, 2026 at 10:15 am

    Ans for Q1:

    var str = "Have a nice day";
    str = str.replace(/./g, ' ');
    

    Ans for Q2:

    String.prototype.repeat = function(n) {
      return new Array(n+ 1).join(this);
    };
    
    "A".repeat(10);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose you have the following string: Hello... how are you!!?? I'm bored!! I want
I have two questions. 1: String = xx yy ** I want to remove
hi , I have 2 related questions. 1)suppose we have: string strMessage=\nHellow\n\nWorld; console.writeln(strMessage); Result
Let's suppose I have a string that contains 7.2769482308e+01 (this number came from 3rd
I have two questions about java.awt.Shape . Suppose I have two Shape s, shape1
I have some questions about using MySQLi queries, and related memory management. Suppose I
I suppose this question is more general than working with COM components. I have
A newbie question,really. Suppose I have a html table like this: <div id=div1> <table
This question is related to awk, I suppose. I have no experience with awk.
Lots of confusion in this topic. Several Questions have been asked. Things still seem

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.