Skip to content

Add a trim_whitespace convenience method#17

Merged
diondokter merged 1 commit into
diondokter:masterfrom
JJaviMS:master
Jan 2, 2026
Merged

Add a trim_whitespace convenience method#17
diondokter merged 1 commit into
diondokter:masterfrom
JJaviMS:master

Conversation

@JJaviMS

@JJaviMS JJaviMS commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Hi, I have implemented a convenience method that will help trim whitespaces when the user may need them.

There are cases when the response comes with some \r\n, which are not really necessary. Using this method, those bytes will be skipped, and the user only needs to think about the message.

Let's assume a message: \r\nAT+CPIN: READY\r\n\r\nOK\r\n, if I want to parse this when I use the library, I need to take care of putting those \r\n. Using the trim_whitespace methods, the strings will be simplified, and the headaches of checking the whitespaces will be gone.

Now the library performs the trim_space, maybe that can be replaced with the 'trim_whitespaces'.

@diondokter

Copy link
Copy Markdown
Owner

Nice!

@diondokter diondokter merged commit ddc050e into diondokter:master Jan 2, 2026
4 checks passed
@diondokter

Copy link
Copy Markdown
Owner

Do you have more in store? If not I'll cut a new release soon. But if you do, I'd rather wait and collect them all.

@JJaviMS

JJaviMS commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

Do you have more in store? If not I'll cut a new release soon. But if you do, I'd rather wait and collect them all.

I think this is the last one in a while :)

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