Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hwllo..
Can i add spaces in a string..?

For Eg. "CODEPROJEC" is a word and I want to replace it into "CODE PROJECT"
Posted
Updated 31-Jan-16 17:52pm
v2

1 solution

have you tried

C#
Dim strSource As String = "CODEPROJECT"
Dim strModified As String strSource.Insert(4, " ")


?
 
Share this answer
 
Comments
Richard MacCutchan 30-Jan-16 5:28am    
You mean try before posting the question? ROFL.
Vikas Hire 30-Jan-16 6:14am    
ok..
and if i want to add multiple spaces in string. Can I do this as same way.

eg. MHH454JH4KJ6 as MHH 454 JH 4 KJ 6
actually i want to separating Alphabets and numbers in string
Richard MacCutchan 30-Jan-16 7:38am    
Yes, but you need to write the code to separate the different parts of the text. And since you are the person that knows what is required, you are best placed to do it.
Garth J Lancaster 30-Jan-16 22:37pm    
that was going to be my first response, but I thought, nah, the OP just needs a little nudge - what a sucker I was .. grrrrrrr

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900