Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6181671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:04:00+00:00 2026-05-24T01:04:00+00:00

The obvious first thought is: Public Function CheckStrings(ByVal input As String()) As Boolean For

  • 0

The obvious first thought is:

Public Function CheckStrings(ByVal input As String()) As Boolean
    For Each s As String In input
        If s.Length > 0 Then Return True
    Next
    Return False
End Function

I’m sure there is a simpler way than that though. At least simpler in terms of the code if not necessarily the performance.

End result:

Well, you guys did a pretty good job of simplifying. Well done.
I think I’ll still use an extension to make it just that much simpler in the main code. The final result really isn’t too bad by itself though.

Here’s my final code:

<Extension()> _
Public Function AnyNonZero(ByVal value As String()) As Boolean
    If Not value.All(Function(x) String.IsNullOrEmpty(x)) Then Return True
    Return False
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:04:00+00:00Added an answer on May 24, 2026 at 1:04 am

    You can use this to return true if all elements are zero length.

    Dim inputIsEmpty As Boolean = Array.TrueForAll(input, Function(x) x.Length = 0)
    

    Be careful of null references. You may want to use this instead:

    Dim inputIsEmpty As Boolean = Array.TrueForAll(input, Function(x) String.IsNullOrEmpty(x))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a user input form here: http://www.7bks.com/create (Google login required) When you first
I currently have this method: public function getUser($id) { $user = $this->db->getSingleRecord(SELECT user_id, user_login,
I first thought about using ITDs to define the private static final Logger logger
The obvious way to plot a path with virtual earth (VEMap.GetDirections) is limited to
An obvious answer is an internal wiki. What are the pros and cons of
For obvious productivity reasons, I make an effort of learning and using as many
This might seem obvious but I've had this error when trying to use LINQ
It seems obvious that some people have been able to figure out how to
I already know the obvious answer to this question: just download <insert favorite windows
Ok so the obvious answer is, because the flow of a composite control demands

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.