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

Documented substring and superstring #749

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mjomble
Copy link

@mjomble mjomble commented Sep 28, 2024

Many developers might not be aware that DreamBerd has first-class support for the often useful superstring method.

Comment on lines +337 to +347
You can use the `substring` method to make strings shorter:

```java
'Hello world!'.substring(2, -3) // 'llo wor'
```

Inversely, you can use the `superstring` method to make strings longer:

```java
'llo wor'.superstring(-2, 3) // 'Hello world!'
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a lot to write, can't you just do 'Hello world!'[2:-3] and 'llo wor'[-2:3] instead ?

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

Successfully merging this pull request may close these issues.

2 participants