-1

I want to have an input box, you type in a string and it gives you an output but there is a space after every character (even spaces). Example:

"Hello There." → "H e l l o  T h e r e ."

Everything I've tried online never worked (I would get a lot of errors).

  • What person in their right mind up-votes this question? Enlighten me please, what makes this deserving of an up-vote? – user692942 Oct 18 '20 at 17:59
  • Start with a `For` loop that iterates through the string characters for the `Len()` of the string and append a space? What exactly did you try that supposedly errored? – user692942 Oct 18 '20 at 18:03
  • 3
    Does this answer your question? [Adding a space to every character without creating a column with them VBScript](https://stackoverflow.com/questions/63838126/adding-a-space-to-every-character-without-creating-a-column-with-them-vbscript) – Étienne Laneville Oct 18 '20 at 22:43
  • 1
    Looks like a dups, and solution is there: https://stackoverflow.com/a/63838810/632926 – gabrielstuff Oct 18 '20 at 23:22
  • Does this answer your question? [Get each character in a string using VBScript](https://stackoverflow.com/q/1135826) – user692942 Oct 19 '20 at 08:39

1 Answers1

2

You should add this function Space : Return a string consisting of a specified number of spaces.


With the comment of @Lankymart you can write something like that in vbscript :

Option Explicit
Dim Title,Input,i,OutPut
Title = "Add a space after every character in VBS" 
Input = InputBox("Hello There.",Title,"Hello There.") 
If input <> "" Then 
    For i = 1 To Len(Input) 
        OutPut = OutPut &  Mid(Input,i,1) & space(1) 
    Next 
End If
MsgBox OutPut,vbInformation,Title
Inputbox "The String " & chr(34)&  Input & chr(34) &" is converted to ",Title,OutPut
user692942
  • 16,398
  • 7
  • 76
  • 175
Hackoo
  • 18,337
  • 3
  • 40
  • 70
  • By answering this all you do is encourage others to ask the same poorly conceived questions. You should be flagging the question and moving on. – user692942 Oct 18 '20 at 18:55
  • It also means it won’t Roomba now, so thanks for that. – user692942 Oct 18 '20 at 21:56
  • It's a [duplicate](https://stackoverflow.com/a/63838810/632926) of a [duplicate](https://stackoverflow.com/q/1135826/692942), you know that. So why are you so surprised? – user692942 Oct 19 '20 at 08:40