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

Add system dependant version of String.trimIndent() #808

Closed
alexander-yevsyukov opened this issue Dec 12, 2023 · 1 comment
Closed

Add system dependant version of String.trimIndent() #808

alexander-yevsyukov opened this issue Dec 12, 2023 · 1 comment

Comments

@alexander-yevsyukov
Copy link
Contributor

alexander-yevsyukov commented Dec 12, 2023

We have String.ti() extension function which handles the issue with hardcoded line separators in Kotlin string utilities.

We also need analogue for the String.trimIndent() function, which does the same. This would be specifically useful for tests related to code generation.

The implementation is trivial:

public fun String.ti(): String = trimMargin().fixLineEndings()

We also probably may want to open access to fixLineEndings() which is now private to the file.

@alexander-yevsyukov
Copy link
Contributor Author

Resolved by #810.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant