Skip to content
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

skipWhiteSpace under-documented #3820

Open
DagBruck opened this issue May 28, 2021 · 3 comments
Open

skipWhiteSpace under-documented #3820

DagBruck opened this issue May 28, 2021 · 3 comments
Labels
documentation Issue addresses the documentation L: Utilities Issue addresses Modelica.Utilities

Comments

@DagBruck
Copy link
Contributor

The function Modelica.Utilities.Strings.Advanced.skipWhiteSpace appears to be under-documented. The cases I have found are:

  1. What does it return when the given string contains only whitespace or is an empty string?
  2. What does it return if the start index is greater than the string length.

Here are three test cases.

Modelica.Utilities.Strings.Advanced.skipWhiteSpace("")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace("  ")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace(" a ", 700)

@DagBruck DagBruck added documentation Issue addresses the documentation L: Utilities Issue addresses Modelica.Utilities labels May 28, 2021
@DagBruck
Copy link
Contributor Author

DagBruck commented May 28, 2021

Modelica.Utilities.Strings.Advanced.skipWhiteSpace("")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace("  ")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace(" a ", 700)

Might add that it returns 1, 3 and 700 for these cases. The last one in particular is questionable.

@sjoelund
Copy link
Member

Modelica.Utilities.Strings.Advanced.skipWhiteSpace("")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace("  ")
Modelica.Utilities.Strings.Advanced.skipWhiteSpace(" a ", 700)

Might add that it returns 1, 4 and 700 for these cases. The last one in particular is questionable.

Is that a Windows thing? It returns 1, 3 and 700 for me on Linux...

@DagBruck
Copy link
Contributor Author

Might add that it returns 1, 4 and 700 for these cases. The last one in particular is questionable.

Is that a Windows thing? It returns 1, 3 and 700 for me on Linux...

No a typo on my part :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issue addresses the documentation L: Utilities Issue addresses Modelica.Utilities
Projects
None yet
Development

No branches or pull requests

2 participants