4

these are the words in array

    WorkNumber
    WorkType
    Version 
    Status
    Module
    Priority
    AssignedBy
    AssignedTo
    Subject 
    Details 
    EstimatedTime 
    ActualTime
    CreatedDate
    ModifiedDate

i need the output as following

Work Number
Work Type
Version 
Status
Module
Priority
Assigned By
Assigned To
Subject 
Details 
Estimated Time 
Actual Time
Created Date
Modified Date
Thulasiram
  • 8,432
  • 8
  • 46
  • 54
  • possible duplicate of [Add a space before capital letter](http://stackoverflow.com/questions/5582228/add-a-space-before-capital-letter) – Felix Kling Jul 11 '12 at 07:42
  • jQuery is more about manipulating DOM elements. For string operations use standard [String methods](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/#Methods_unrelated_to_HTML). – nnnnnn Jul 11 '12 at 07:54

1 Answers1

14

This is what you need :

"YourString".replace( /([a-z])([A-Z])/g, "$1 $2");

Will output :

"Your String"
jbrtrnd
  • 3,815
  • 5
  • 23
  • 41