Harsha Swamy
Harsha Swamy
Computer Science
14 Mar 2019

How to add spaces in between characters in a char array without using builtin fuctions

Input- "java"

output-" j a v a"

That is inserting a space in between two characters in a char array

In a char array without using any built in functions like append. if possible provide the code also

Anoop Kumar

Anoop Kumar

Information Technology
1 week ago

I will give you logic

//------------------ 
... 
For  int i = 0  to inputString.Length -1 
    If i == 0
        print inputString.charAt(i)
    Else 
        Print <space>
        Print inputString.charAt(i)
    End If
End For loop
... 
//------------------ 


Harsha Swamy

Harsha Swamy

Computer Science
1 week ago

no bro doesn't work 

Anoop Kumar

Anoop Kumar

Information Technology
1 week ago

Give your code please ! 

I don't see any issue with the logic. I created a code snippet and it works fine.

Harsha Swamy

Harsha Swamy

Computer Science
1 week ago

My bad it actually worked thanks Anoop....

Share this content on your social channels -

Only logged in users can reply.