Skip to content

Add .Between extension methods #9

Closed

Description

@DualBrain

It is very often that you would like to check to see if a value is between two other values. I've been utilizing a set of extension methods that seems to provide a means to ease this as well as provide for an easier to understand implementation...

If value >= minimum AndAlso value <= maximum Then

versus

If value.Between(minimum, maximum) Then

This, of course, requires several overloaded versions; numeric, date, etc. Thoughts?

Activity

  1. DualBrain commented on Feb 25, 2022

    @DualBrain
    CollaboratorAuthor

    Alternatively, would it make sense to make function to handle this (instead of extension methods)?

    If Between(value, minimum, maximum) Then

    Additional questions...

    Would it make sense to call this something else? Should there be two variants where one is truly between (exclusive) and one is within (inclusive)?

  2. locked and limited conversation to collaborators on Feb 25, 2022
  3. converted this issue into a discussion #11 on Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions