Address issue in which slashes weren't being appropriately trimmed for p...

Addresses https://github.com/yui/yui3/issues/1964

@caridy @ericf @juandopazo 

I think using `charAt()` would be a better fit here, and match the original code more closely.