stardog-union / stardog-language-servers

Language Servers for Stardog Languages
Other
30 stars 6 forks source link

only split on first namespace = #27

Closed anneeb closed 5 years ago

brianru commented 5 years ago

Would this work with the example in the bug report? In that example the last = is the end of the namespace. https://github.com/stardog-union/stardog-studio/issues/1245

anneeb commented 5 years ago

@brianru it should

> const str = '1=2=3=4=5='
undefined
> const [a,...b]=str.split('=')
undefined
> b
[ '2', '3', '4', '5', '' ]
> b.join('=');
'2=3=4=5='

EDIT: it also works for multiple trails

> const str2 = '1=2=3=4=5===='
undefined
> const [c,...d]=str2.split('=')
undefined
> d
[ '2', '3', '4', '5', '', '', '', '' ]
> d.join('=')
'2=3=4=5===='