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 435201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:21:08+00:00 2026-05-12T20:21:08+00:00

Right – to start with, I’m entering unfamiliar areas with this – so please

  • 0

Right – to start with, I’m entering unfamiliar areas with this – so please be kind!

I have a script that looks a little something like this:

Private Function checkString(ByVal strIn As String) As String
    Dim astrWords As String() = New String() {"bak", "log", "dfd"}
    Dim strOut As String = ""
    Dim strWord As String
    For Each strWord In astrWords
        If strIn.ToLower.IndexOf(strWord.ToLower, 0) >= 0 Then
            strOut = strWord.ToLower
            Exit For
        End If
    Next
    Return strOut
End Function

It’s function is to check the input string and see if any of those ‘astrWords’ are in there and then return the value.

So I wrote a bit of code to dynamically create those words that goes something like this:

Dim extensionArray As String = ""
    Dim count As Integer = 0
    For Each item In lstExtentions.Items
        If count = 0 Then
            extensionArray = extensionArray & """." & item & """"
        Else
            extensionArray = extensionArray & ", ""." & item & """"
        End If
        count = count + 1
    Next
    My.Settings.extensionArray = extensionArray
    My.Settings.Save()

Obviously – it’s creating that same array using list items. The output of that code is exactly the same as if I hard coded it – but when I change the first bit of code to:
Dim astrWords As String() = New String() {My.Settings.extensionArray}
instead of:
Dim astrWords As String() = New String() {“bak”, “log”, “dfd”}
It starts looking for the whole statement instead of looping through each individual one?

I think it has something to do with having brackets on the end of the word string – but I’m lost!

Any help appreciated 🙂

  • 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-12T20:21:08+00:00Added an answer on May 12, 2026 at 8:21 pm

    When you use the string from the settings in the literal array, it’s just as if you used a single strings containing the delimited strings:

    Dim astrWords As String() = New String() {"""bak"", ""log"", ""dfd"""}
    

    What you probably want to do is to put a comma separated string like "bak,log,dfd" in the settings, then you can split it to get it as an array:

    Dim astrWords As String() = My.Settings.extensionArray.Split(","C)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I have a script that creates symlinks to anything newer than 2
Right now I have this SQL query which is valid but always times out:
Right now I have double numba = 5212.6312 String.Format({0:C}, Convert.ToInt32(numba) ) This will give
Right below the start of the <body> tag, I want to include a script
Right now I have an application that loads a bunch of thumbnail images into
Right now I want to store a text file that goes like this: 1
Right now my code looks like this: Cursor cursor = getContentResolver().query(messagesUri, null,address=?, smsNo, null);
right now i have this code using phonegap and jquerymobile $( '#user_detail' ).live( 'pageinit',function(event)
Right now I have this code: int number = 0; DirectoryInfo di = new
Right now, I have a jQuery UI pop-up dialog that reads from an external

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.