Skip to content

Instantly share code, notes, and snippets.

@djtech42
Created December 3, 2015 15:55
Show Gist options
  • Save djtech42/0757add055afa240e02f to your computer and use it in GitHub Desktop.
Save djtech42/0757add055afa240e02f to your computer and use it in GitHub Desktop.
Function that returns a string with added grouping notation if it exists
def stringOptional(string, preceding="", succeeding="")
unless string.nil?
return preceding + string + succeeding
else
return ""
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment