View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12921 Members
Join this group to post and comment.

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 • Mar 14, 2019

I will give you logic

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


no bro doesn't work 

Anoop Kumar
Anoop Kumar • Mar 14, 2019

Give your code please ! 

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

My bad it actually worked thanks Anoop....

Share this content on your social channels -