Jquery space to underscore. This can be done easily using jquery.
Jquery space to underscore js is a lightweight JavaScript library and not a complete framework that was written by Jeremy Ashkenas. Jul 23, 2025 · Here are the various methods to replace multiple spaces with a single space in JavaScript. It can be used to create space in variable names and to disregard function parameters, and it’s also employed in libraries like underscore. Ex May 29, 2023 · I am searching for a regular expression for allowing alphanumeric characters, -, _ or spaces in JavaScript/jQuery. getElementById(), which is extremely efficient. This is a useful technique for formatting strings that contain multiple words, and can be used in many different situations. How do I do this in JavaScript or jQuery? I tried this and not working. I want allow spaces as well. Description: Sometime we want to restrict user to enter spaces in between text by replacing the space entered with underscore as shown in image above. The object, embed, and applet elements cannot attach data, and therefore cannot have jQuery events bound to them. Dec 1, 2024 · In this article, we will explore how to use jQuery for input masking. From using the replace() method to creating a custom function, each approach has its unique benefits. replace (/_/g, " ") to replace them with a space. How to create the "_" symbol Creating the "_" symbol on a U. Underscore provides over 100 Oct 3, 2016 · Step 1: Source & Include jQuery. Aug 26, 2013 · How to replace a space with an underscore in PHP?It is an online blog for Web developers and scrum masters, with a focus on useful techniques, problems and their solution, best practices and valuable resources in PHP, Codeigniter, Javascript, Node, Jquery, agile , scrum and many more. Initially I have: var s jQuery : How to replace space to underscore at same time (when i enter the text in input field)?To Access My Live Chat Page, On Google, Search for "hows tech Feb 15, 2014 · I am attempting to create a way to convert text with lowercase letters and underscores into text without underscores and the first letter of each word is capitalized. So, a forward slash isn't a valid Easily replace spaces with underscores in text with our free online tool. ). My validation accepts only alphabets. So, Mar 5, 2014 · Here I will explain JQuery regular expression to allow special characters, spaces and alphanumeric text or regular expression to allow special characters, spaces and alphanumeric characters in JQuery. $. Similar example: Automatically add a Dash or Hyphen after every 3rd character using JavaScript or jQuery Now, change the hyphen with an underscore (_). There are some JavaScript methods are used to replace spaces with underscores which are listed below: JavaScript replace () method: This method searches a string for a defined value, or a regular expression, and returns a new string with the replaced defined value. I need to find a reg ex that only allows alphanumeric. Aug 23, 2017 · I have created a game that is based on a grid being populated with words In my code I have a small bit of underscore. Jul 29, 2015 · It would be awesome to have the option to of automatic replacement of a space with dash or underscore. com. Jul 23, 2025 · 1. Enhance readability and optimize your content. Nov 23, 2024 · Explore top techniques to seamlessly replace spaces with underscores in JavaScript strings using various methods and practical examples. a. The function checks characters one by on if there is space or not. xyz" Not Allowed:- "abc def. Mar 6, 2010 · I want to replace all the occurrences of a dot(. Hi Guys i have this following code in jquery which is not allowing me to enter underscore. Separator value may be space, comma. replace on the source but it doesn't seem to work. I would want 0-9 and all letters, underscore, hyphen, and a period allowed, nothing else Special characters like ! " # $ % & ’ ( ) *, etc not allowed. NET-based portals. I was thinking about just splitting by - then con Underscore Code Examples Below you can find HTML and CSS examples for your website or application for the _ Underscore Symbol. Underscore - A JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. Contents Essential Conventions Minimizing Globals Use jslint Coding Conventions Uses two-space indentation Using shorthand for conditional statements Opening Brace Location Closing Brace Location Function With regex (i assume) or some other method, how can i convert things like: marker-image or my-example-setting to markerImage or myExampleSetting. Sep 4, 2013 · I have this code which allows all characters in a text box. I wrote the below code but the code does not work correctly. Lodash: It is a JavaScript utility library that delivers consistency, modularity, and Aug 29, 2016 · A split() method is used to split a string into an array. JSFiddle - Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle. Apart from jQuery, I like underscore / lodash. Also, you use ^ and $, which mean that the string must start with whatever comes after ^ and must end with whatever comes before $. I want to restrict it. Using replace () Method with Regular Expression (Most Common) The replace () method combined with a regular expression is the most efficient way to replace multiple spaces with a single space. To input an underscore on most keyboard, press the SHIFT key and the - key (hyphen, typically located to the right of the number 0 key). I want to place a space between My and Sites. Instructions: Enter your text in the first textarea and the converted text with underscores will be displayed in the second textarea. js is a 'utility-belt library' and it makes it a breeze to solve many of the common problems you'll see when working with jQuery. Usage of underscore (_) in JavaScript Apr 28, 2025 · The dollar sign ($) and the underscore (_) characters are JavaScript identifiers, which just means that they identify an object in the same way a name would. com Jul 11, 2025 · Given a sentence and the task is to replace the spaces (" ") from the sentence with underscores ("_") in JavaScript. If the space is encountered, then it is replaced with the "%20" sequence, else it appends the characters into the output string. Feb 2, 2024 · Use the replace Method to Replace Space With Underscore in JavaScript Use the split and join Methods to Replace Space With Underscore in JavaScript In JavaScript, we can replace single or multiple spaces from a string with provided string portion using the default JavaScript string methods like replace(), split(), join(), etc. js and has jQuery in noconflict mode. js + Underscore. Sep 14, 2015 · Learn how to restrict input in a TextBox to only alphanumeric characters using jQuery with simple and effective code examples. js and jQuery. We can ge Description: Sometime we want to restrict user to enter spaces in between text by replacing the space entered with underscore as shown in image above. js First and foremost, you’ll need to import and reference the jQuery. I’m a total beginner when it comes to js and expressions, so after as much research as I could muster thus far, I’ve come to this formula, but it’s obviously not working and I’m not sure how close I am to getting it right. Say you have product names with product and manufacturer separated by spaces (as shown below), and you want to separate them by underscores instead. Then just copy and paste your Embedded Underscore text to use! Jul 27, 2021 · Hey all, I’m looking to to use RegexReplace to replace spaces with dashes in my text phrases. Feb 16, 2016 · Learn how to manipulate data effectively with Underscore JS. Neither of these samples work: $("#mySelector"). Mar 19, 2019 · How can I convert a string into camel case using javascript regex? EquipmentClass name or Equipment className or equipment class name or Equipment Class Name should all become: equipmentClassName. How can I do this in jQuery or JavaScript? Jan 29, 2019 · explained with an example, how to allow only AlphaNumeric, Dot (Period) and Underscore characters in Username using JavaScript. Let us learn about "how to replace spaces with underscores in JavaScript". c". Based on the Sindre Sorhus Camelcase Module, they have the same test Followed by the letter g, which means it will do a global search of the hyphen (or any given character) in the string. Simply highlight and copy the code you need, and paste it into you text, HTML or CSS code editor. html ] jQuery : How to replace underscores w Jul 14, 2009 · I'm trying to append a DOM element of a script with a given 'src' attribute, but jQuery always intercepts that and adds a timestamp parameter. The short answer is: use replace() of jQuery and mention the space you want to remove. Simply enter the text and the online tool convert spaces to underscores. js with our essential FAQ playbook, guiding developers through mastery of this powerful utility library. split () and join () Suitable for basic space-to-underscore replacements and other string manipulations. Particularly because he is doing this in JavaScript, and replacing the space character (but not other whitespace) with the + character is a standard way to encode URLs. Example: Oct 6, 2019 · the current script dose work in displaying the value of the input field, but i would really like to show the underscore if a space is inserted. How can I do this using jquery?? I have been looking for this for a while, and while I have found many responses for changing a space into a dash (hyphen), I haven't found any that go the other direction. I want to split the filename to get the extension. Sep 25, 2016 · I have many classes and want to remove the commas in them if any commas exist there. Replacing spaces with underscores is a crucial step in standardizing data fields, ensuring seamless jQuery : How to replace underscores with spaces? [ Beautify Your Computer : https://www. Syntax Aug 18, 2024 · Summary In this tutorial, we explored five quick methods to replace space with underscore in JavaScript. Discover powerful functions to simplify and enhance your JavaScript coding skills. ex; options_page = Options P I have an select on my page with the value of Test One <option value="Test One">Test One</option> I wondered if there was a way to replace spaces in words using jQuery I'm aware of the Jul 11, 2025 · We will explore several methods to replace special characters in a string with an underscore (_) in JavaScript. Sep 7, 2023 · What is the used of underscore (_) in JavaScript? The underscore symbol (_) serves several purposes in JavaScript. hows. I've tried . Feb 21, 2018 · You have a good point. This my demo code : https://plnkr. It provides utility functions for a variety of use cases in our day-to-day common programming tasks. It allows only alphabets and numbers as first character. So that means that a variable named status would contain a simple enumerator, but a The term underscore_case comes from the appearance of the underscores between words, which resemble a snake slithering on the ground. Even though general practice for AMD registration is to be anonymous, underscore registers as a named module because, like jQuery, it is a base library that is popular enough to be bundled in a third party lib, but not be part of an AMD load request. tech/p/recommended. Feb 12, 2015 · select value with space jquery Asked 10 years, 9 months ago Modified 10 years, 9 months ago Viewed 4k times Apr 22, 2022 · I'm using jquery-ui to create a search dropdown, but I'd like to replace underscores with spaces in the dropdown results. For example: string = "img_realtime_tr~ading3$" The resulting string should look like "img_realtime_tr_adi Camel case 🧶 Convert dash/dot/underscore/space separated string to camelCase View on GitHub Camel case Convert a dash/dot/underscore/space separated string to camelCase or PascalCase. Jul 23, 2010 · We have a form that has fields for first and last name. Jun 22, 2010 · [eluser]wdcmatt [/eluser] alpha numeric dash and SPACE! I searched google for about 20 min and did not find a nice way to do this, i found a few poorly written one line scripts, still not to my liking, here is what I came up with hopefully it can help someone else Jan 24, 2012 · 6 Remove numbers, underscore, white-spaces and special characters from the string sentence. js Underscore. co/edit/ Mar 30, 2017 · I tried adding the jquery you posted and the css class concatenatedString to the field the two values are being brought into, but the underscore is not being replaced with a space. Includes examples and code snippets. The second class value is replaced with the first Mar 16, 2016 · I have strings coming into my javascript the variations can be. Underscore provides over 100 Feb 20, 2025 · Explore the journey of transitioning from jQuery to Underscore. We can use any delimiter to split the text. js JavaScript libraries. If you like to write capital letter then need to on Caps Lock of your keyboard. keyboard To create the underscore using a U. I know this is quite a pretty basic thing to do (once you’re Sep 20, 2012 · Could anybody give me an explanation of the underscore in a jQuery plugin function? I have no idea of what " _ " means. Jan 26, 2022 · Here is an example to remove them:,Use . If you need more information on a specific topic, please follow the link on the corresponding heading to access the full article or head to the guide. js, highlighting insights and advantages for modern JavaScript developers. optional (element) || value Mar 2, 2016 · This example replaces every space in the file with underscores. My team also frequently adds $ suffix to the end of variable names that hold observable objects (like rxjs). It's also a common practice to prefix intentionally unused variables with an underscore and configure linters to ignore them. Each underscore should have a space replacement, which means multiple consecutive underscores should have respective number of empty spaces. replace () with Regular Expressions Offers more flexibility and control for complex pattern matching and replacements. append($(" ")); $("#mySelector"). But if you don't care about standards try $("[id='content Module']") Similar thread > What are valid values for the id HTML5 allows almost anything as the value for the id attribute. Syntax: $('input_selector'). xyz" How can I do this using jQuery? Oct 28, 2009 · Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. pluck(list, propertyName) A convenient version of what is perhaps the most common use-case for map: extractin Nov 14, 2023 · And that's it! You now know four different ways to type an underscore on your keyboard. Choose the method that suits you best and start incorporating underscores into your text effortlessly. replace (/_/g, "") to remove all underscores or use . is. Calling jQuery() (or $()) with an id selector as its argument will return a jQuery object containing a collection of either zero . I just want one what would allow Feb 27, 2023 · This tutorial demonstrates how to replace a space character with an underscore in Excel and Google Sheets. I had Learn how to use JavaScript Regex to create a pattern that allows only numbers, letters, and underscores in names. Foo Bar (double space) or Foo Bar I currently have this working out if it has a single space, replace with an underscore var s Learn how to use jQuery to handle elements with IDs containing blank spaces in ASP. In the realm of data cleaning and preparation, consistency is paramount. Sep 8, 2018 · I have a string "MySites". Keep in mind, browsers will convert the to a space and display it as a space in most cases, so you may not see any difference if you alert it or display it (as you can see above). I tried implementing it but no dice. escapeSelector () should be used to escape such selectors. Perfect for form validation and data entry. In case a jQuery object is passed, it should contain input elements with name/value properties. . Oct 17, 2020 · Your regex doesn’t work because first, you’ve put the regex into quotes, so you’re checking if your string contains this substring: '/^[\s,]$/g'. The HTML 4. Try it for replacing spaces in text! jQuery provides a method "split()", which splits the text. Earlier I had posted about jQuery solution to replace string, substring, trim string and about all string functions, And In this post, see jQuery/JavaScript split function in action with example. Free online tool that replaces spaces/whitespace with underscores instantly. So far I tried: mystr In this tutorial, learn how to remove all white spaces from text using jquery. Introduction This example will explain how to allow only characters [a/z] in text box using Jquery. Don't use spaces, the reason for this is simple, space character is not a valid for ID attribute. 01 spec states that ID tokens must begin with a letter ( [A-Za-z]) and may be followed by any number of letters, digits ( [0-9]), hyphens (-), underscores (_), colons (:), and periods (. append($("&nbsp;")); Any ideas? jQuery's event system requires that a DOM element allow attaching data via a property on the element, so that events can be tracked and delivered. The objects they identify include things such as variables, functions, properties, events, and objects. I don't know of any sql injection that uses underscores, but I also don't know of anyone with an undersco I am trying to extract everything before the ',' comma. Mar 10, 2016 · Line-by-line walkthrough of underscore extend Underscorejs is an open source library of useful functions that help make your code more compact. We will cover setting up the development environment, understanding basic input masking, implementing input masking with the jQuery Mask Plugin, customizing input masks, and handling user interaction and validation. Whether you need a simple replacement or a more complex solution, these methods will help you handle spaces effectively. addMethod ("alpha", function (value, element) { return this. string'; I want to get: okay this is a string. ID tokens must begin with a letter ( [A-Za-z]) and may be followed by any number of letters, digits ( [0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (". The g character after the regular expressions represents the global replacement. just a simple regex. Feb 2, 2017 · regex which allows utf-8 characters but restricts underscore abd specials chracters (except this one -). Sep 21, 2014 · How to replace space to underscore at same time (when i enter the text in input field)? Asked 12 years, 2 months ago Modified 11 years, 1 month ago Viewed 13k times See full list on bobbyhadz. Sep 7, 2025 · Where is the underscore key on the keyboard? Below is an overview of a US QWERTY computer keyboard with the underscore key highlighted in blue. Only in very specific cases. Each section will include full executable code examples with detailed explanations. So whitespaces should be replaced by dashes and all Oct 28, 2009 · Underscore is a JavaScript library that provides a whole mess of useful functional programming helpers without extending any built-in objects. The underscore character is a keyboard character that is used for various poses. How do we do it? Backbone for example shows that we can point to jQuery using Jan 24, 2011 · Learn how to use underscore. It’s not evaluated as a regex anymore, but as a string literal. How do I block special characters from being typed into an input field with jquery? Learn how to split a string in jQuery with this easy-to-follow guide. Jul 1, 2011 · Description: Create a serialized representation of an array, a plain object, or a jQuery object suitable for use in a URL query string or Ajax request. Nov 8, 2014 · I want to split a string in jquery. When I searching it on here I found this code, but it allow only lowercase letters. My string is a filename. Jan 11, 2017 · 1 I am creating a web page where I have an input text field in which I want to allow only alphabets,dots and spaces like "a b. In math, the underscore character is used in typesetting systems to denote subscript expressions. Replace Space With Underscore In Excel, you can easily replace spaces with underscores. I am quite new to javascript/jquery so please don't judge my setTimeout-n00bidity to hard: Sep 4, 2017 · JQuery - Replace Underscore With Space Asked 7 years, 4 months ago Modified 7 years, 4 months ago Viewed 3k times It's worth noting that if the user was to highlight everything in the textbox, they could press space and that space would be inserted. Space and dot allowed between consecutive words/characters but two consecutive spaces or dots are not allowed. Check out the website for a list of functionality it provides, but I’ll split it into two … Sep 5, 2012 · jQuery string split the string after the space using split () method Asked 13 years, 2 months ago Modified 2 years, 8 months ago Viewed 76k times Jul 8, 2025 · Regular expression syntax cheat sheet This page provides an overall cheat sheet of all the capabilities of RegExp syntax by aggregating the content of the articles in the RegExp guide. 1. This makes the script's source URL look like Sep 30, 2009 · I'm trying to append a space using jQuery. Correctly handles unicode strings. This can be done easily using jquery. (dot) in PHP where it will be replaced by an _ (underscore) in $_GET and $_POST. js to manipulate arrays and objects. Unlike camelCase, which eliminates spaces and capitalizes each word after the first, or PascalCase, which capitalizes every word, underscore_case maintains readability with underscores. I need to reformat a string using jQuery or vanilla JavaScript Let’s say we have "Sonic Free Games". Main Features It will allow backspaces and white spaces while entering the text in input text box. S. Many times we want to remove with some values so in this article we are removing the space values with underscore while typing. 1345 albany street, Bellevue WA 42344 I just want to grab the street Sep 8, 2009 · There are no other restrictions on what form an ID can take; in particular, IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc. Feb 21, 2013 · I need to include underscore. Example: In this example, we're using the Iterations approach in Jan 18, 2012 · I'm just starting to learn JavaScript, and stumbled over Underscore. Get started today and improve your jQuery skills! Dec 20, 2011 · JavaScript Architecture: Underscore. Oct 25, 2015 · I agree that you might not need it, but the examples show that in many cases jquery is so much more elegant than raw JavaScript. Example code below: Apr 28, 2025 · Using regex with the input event In this approach, we will use the regular expression with the input event that checks the correctness of the entered input at the same time and write the respective text for the same. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match. Some have already mentioned lodash and jQuery. Example: {"name": "My_name"} But I'm calling the name function in multiple places, one such place is in an image tag where the underscore is necessary, using JavaScript I want to select a certain div with the name in it and replace the underscore with space. A step-by-step guide for replacing all spaces in a JavaScript string with a dash using the replace() method. 0 or later, the function jQuery. ) in a JavaScript string For example, I have: var mystring = 'okay. Underscored Text Generator ToggleCase cuts out all the hassle of manually replacing spaces with underscores to create Embedded Underscore text. validator. Struggling with jQuery not allowing underscores in input fields? This guide shows you how to modify your JavaScript code to accept alphanumeric characters an Underscore. ,you can remove underscore from response or any string like this: "hello_rizo",Like the title says, i would like to remove an underscore within a String with a regex. And no blank spaces. Now, how do I allow only space and underscore along with alphabets and numbers? Nov 23, 2024 · Explore top techniques to seamlessly replace spaces with underscores in JavaScript strings using various methods and practical examples. js, like jQuery, is a toolbox of utilities. Apr 6, 2011 · I want to replace all underscores with single space and I want to store it it another variable. Classnames can contain any character, and they don’t have to start Apr 23, 2024 · On jQuery version 3. Jan 20, 2020 · Not sure how to correctly use an underscore? The understrike? The underbar? The underdash? Follow this grammar guide on KLWightman. Underscore looks really cool but I wonder if jQuery does not already provide functions similar to Underscore. Analogus to the ubiquitous ‘$’ in the jQuery … Mar 29, 2013 · Does anyone know of a 'pluck' plugin that matches the underscore array method? pluck_. js that helps my words fit in the space available in the grid without breaching Oct 24, 2011 · Neither HTML4 nor HTML5 allows space characters in ID attribute values. I need only the spaces in the folder name to be replaced with underscores. I want to replace all the spaces in the string with underscore. Let me explain you with an example. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. What I am facing is my filename contains any dot then I can't get the extension. keyboard, hold down Shift and press - (hyphen) key. replaceAll () Generally preferred for its simplicity and conciseness in modern Feb 1, 2024 · Hi All, I have a dataset with 50 columns and in column headers each column contains underscore and I want to remove all the underscore with space is there a way to do that Current Scenario To Be Account_Name Year_mo Sales_type Registration_no Account Name Year mo Sales type Registration no Thi Jul 15, 2025 · The lodash and UnderScore both are utility libraries from JavaScript which helps make it easier by providing utils which makes, working with arrays, numbers, objects, and strings much easier. I want to remove special characters from a string and replace them with the _ character. For id selectors, jQuery uses the JavaScript function document. Please tell me any small code for that because my solution is taking too much space. Sep 26, 2010 · In this context I assume by spaces he means only the space character, not just any old whitespace like /s would match. It will restrict to write you special characters, functions keys and other keys as well. I was asked to allow underscores. > Just wondering if this is a bug, or me using a html id attribute in a > manner not allowed? Although jQuery will let you escape some of the characters, the W3C says: ID and NAME tokens must begin with a letter ( [A-Za-z]) and may be followed by any number of letters, digits ( [0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (". Feb 22, 2025 · Unlock the power of Underscore. The underscore symbol serves various purposes, including its usage in programming. Feb 28, 2015 · I want to make a text box allow only lowercase (a-z), uppercase (A-Z) letters and space using jQuery. Aug 17, 2023 · This tutorial explains how to replace a space with an underscore in Excel, including several examples. I want to convert it to "sonic-free-games". Simply type or paste any words you want to convert into the form below, and hit the magic Underscored Text button. js as a template engine with examples and tips on Stack Overflow. Allowed:- "abc def. on('input', function(){}); Example: The below code example will help you understand the use of the regex with input event to check for the correct input. it is allowing underscore. js in a platform that primarily uses Prototype. When managing large datasets within Microsoft Excel, spaces often present formatting challenges, especially when data needs to be exported for programming languages or database systems that interpret spaces as delimiters. You have to pass separator value in the split method. If you just remove those, your regex works Dec 25, 2013 · Issue on Replacing Spaces with Underscores in jQuery Asked 11 years, 2 months ago Modified 11 years, 2 months ago Viewed 473 times Nov 16, 2012 · [out-of-date] merged into coding conventionsJavaScript Naming Conventions This document defines JavaScript naming conventions, which are split into essential, coding and naming conventions. If you use this on untrusted user input, don’t forget to limit the length to something reasonable. It’s the answer to the question: “If I sit down in front of a blank HTML page, and want to start being productive immediately, what do I need?” … and the tie to go along with jQuery 's tux and Backbone 's suspenders. Jul 23, 2025 · Underscore. this. For the class attribute, there is no such limitation. Otherwise, the following function takes care of escaping these characters and places a "#" at the beginning of the ID string for convenience: The function can be used like so: How do I determine the state of a toggled element? Jul 8, 2015 · Note: besides = and &, serverside might restrict other legally unencoded query string characters like . Learn how to replace spaces with underscores in JavaScript by using the replaceAll(), replace(), and split() and join() method. This opens up possibilites but can also lead to bugs and maintainability problems unless used wisely. js and Underscore. Looping Less common for this specific task, as the other methods are usually more efficient. They provide a group of tools used for common programming operations having a strong functional programming task. Regex to replace space with dash in jQuery Asked 11 years, 8 months ago Modified 11 years, 8 months ago Viewed 22k times Nov 9, 2013 · As per your need we have to replace all space ie the \s in your string globally. Remember, mastering keyboard shortcuts can save you time and effort in various tasks, so it's worthwhile to familiarize yourself with them. "). Special characters are non-alphanumeric symbols, and replacing them is a common requirement in various use cases such as sanitizing input or formatting file names. I want to get my mentioned variable as my<sp><sp>st<sp>ri<sp>ng. Using Iterations Approach In this specified approach, we are iterating through each character of the given input string by the user. jQuery - jQuery is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML. Any assistance here would be great! Meaning when the user hits the spacebar in that input field a underscore is being displayed instead of a space. Replace Hyphens and UnderScores in One Line Code in JavaScript Jun 1, 2018 · I have a string with spaces separating words. ndgbvgrpqrtbsahpriqpuuvmjyvzlsrwyjtmbqvyfpjiqwosxugfmpswlnasnltjthtvc