So, I want this script to set the Text property of the TextBox to a string called command, and then move the cursor to the end of the string.
local command = CommandName.Text
CommandBar.Text = command
CommandBar.CursorPosition = 100000
Very easy right? Well, the problem is.. it adds the string correctly, but it also adds a "space" after it. This wouldn't be a problem for me but the thing is that other scripts do NOT recognize that "space" as a normal space (like " ") and I need to delete that space everytime. I don't understand what's the problem.
(check comments)

6 comments
(The string command has no spaces) To explain it a little better, instead of setting the text to "text" it sets it to "text " and that space at the end is not recognized as a normal space
this is what happens if I try to print the "fake space" http://prntscr.com/qc5jxf
That print is pretty weird! I've never seen anything like that. I wonder if its something other than a space? can you print the length of the string? string.len(string)
same thing happens http://prntscr.com/qc5o0a
Could be a NBSP but I have no idea why that would be there. Try putting "command" instead of command
After looking at the screenshots you have a "U+0010 : LINE FEED [LF]" or in other words a new line character in the output. This should be fixed by writing "command" instead of command.