Suppose I have this:
set text '-foo'

How can I determine whether the first character of the string in $text is a
dash?
I tried this:
set firstChar (string sub -s1 -l1 "$text")

But that doesn't work because "string sub" thinks I'm trying to specify
another switch since $text starts with a dash, and of course "-foo" is not
a valid switch for "string sub".

-- 
R. Mark Volkmann
Object Computing, Inc.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to