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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:49:38+00:00 2026-05-18T23:49:38+00:00

The question is self explanatory. Could you please point out a way to put

  • 0

The question is self explanatory. Could you please point out a way to put spaces between each capital letter of a string.

SELECT dbo.SpaceBeforeCap('ThisIsATestString')

would result in

This Is A Test String.
  • 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-05-18T23:49:38+00:00Added an answer on May 18, 2026 at 11:49 pm

    Assuming SQL Server 2005 or later, this modified from code taken here: http://www.kodyaz.com/articles/case-sensitive-sql-split-function.aspx

    CREATE FUNCTION SpaceBeforeCap
    (
     @str nvarchar(max)
    )
    returns nvarchar(max)
    as
    begin
    
    declare @i int, @j int
    declare @returnval nvarchar(max)
    set @returnval = ''
    select @i = 1, @j = len(@str)
    
    declare @w nvarchar(max)
    
    while @i <= @j
    begin
     if substring(@str,@i,1) = UPPER(substring(@str,@i,1)) collate Latin1_General_CS_AS
     begin
      if @w is not null
      set @returnval = @returnval + ' ' + @w
      set @w = substring(@str,@i,1)
     end
     else
      set @w = @w + substring(@str,@i,1)
     set @i = @i + 1
    end
    if @w is not null
     set @returnval = @returnval + ' ' + @w
    
    return ltrim(@returnval)
    
    end
    

    This can then be called just as you have suggested above.

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

Sidebar

Related Questions

This is self-explanatory: while (...) { var string='something that changes for each ajax request.';
The question is self-explanatory. What are the differences between these two?
I think the question is self explanatory. If I declare a property of a
The question is pretty much self-explanatory. I Googled many sites, many methods, tried many
Well the question is self-explanatory. One more thing would be, if it is a
Question is self explanatory, again I need an alternativs in cocos2d android to use
OK so my question is self explanatory, here is some code so you can
Maybe the question is not self-explanatory, so I will explain it through. The deal
The title of this question should be pretty self explanatory. I am making an
I think the question itself is pretty self-explanatory. The code is given below -

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.