Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a elegant way to parse a word and add spaces before capital letters

Tags:

People also ask

How do you put a space before a capital letter in a string?

Use the replace() method to insert a space before the capital letters in a string, e.g. str. replace(/[A-Z]/g, ' $&'). trim() . The replace method will return a new string, where each capital letter is replaced by a space preceding the capital letter.

How do you put a space after a capital letter in C#?

" " + x : x. ToString())). TrimStart(' '); This should work.


i need to parse some data and i want to convert

AutomaticTrackingSystem

to

Automatic Tracking System

essentially putting a space before any capital letter (besides the first one of course)