Potential String bug?

I think I’ve found a small bug or something, but someone help me with making this work.

I’m trying to use backwards-slashes in a string to make a windows command prompt type system, but i came across this pest of an issue.

Screenshot_1906

Screenshot_1907

I’ve tried to concatenate the strings and again, no luck, it is definitely something with the back-slash, can anyone help? I really don’t wanna use forward-slash.

(I’m un-sure if this is the right category to post this in.)

1 Like

realized i messed up the second screenshot so here it is again.

Screenshot_1908

The backslash is escaping the functionality of the end quotation of the string (causing it to become part of the string, rather than signifying the end of the string). Use backslashes to escape backslashes:

c.Text = "C:\\Users\\"..player.Name
1 Like

The backslash \ is an escape character, you’re ‘escaping’ the quotation mark… Basically what your string looks like is "C:\Users I think you can add another backslash to escape the first one, it should work like what you’re after.

local DoubleBackslash= string.gsub("bckslsh2", "bckslsh2", "\\".."\\") print (DoubleBackslash)

Is this any good?, i know the post is old.