-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for formatting Strings as in print() (not in a addition to repr()) #22
Comments
Hi @GlenHertz
I agree 100%! Indeed, this is a misunderstanding from my part about the function
Thanks! I'm glad it is being useful :) |
Done! Can you please test @GlenHertz using julia> matrix = [ 1 """
function str(str = "one string")
return str
end"""
2 """
function str(str = "")
if isempty(str)
return "one string"
else
return str
end
end"""];
julia> pretty_table(matrix, alignment = :l, linebreaks = true)
┌────────┬──────────────────────────────────┐
│ Col. 1 │ Col. 2 │
├────────┼──────────────────────────────────┤
│ 1 │ function str(str = "one string") │
│ │ return str │
│ │ end │
│ 2 │ function str(str = "") │
│ │ if isempty(str) │
│ │ return "one string" │
│ │ else │
│ │ return str │
│ │ end │
│ │ end │
└────────┴──────────────────────────────────┘ |
I tested it and it works as desired, thanks! I also ran it through my other code just to see if anything would break and it all works fine. |
Perfect! Thanks for the feedback. |
If a column of strings contains
"
characters then they are printed like:I'd like to be able to print the table as in
print
, like:I typically use PrettyTables for viewing "publication" results (not debugging Julia strings) so I think
print
should be the default format for strings. (Love this package, BTW.)The text was updated successfully, but these errors were encountered: