Solved

INSRT/mid use in VB.net

Posted on 2004-09-20
7
193 Views
Last Modified: 2006-11-17

How do I get the parsing on this in vb.net?

Given :  August 31, 2004. htm

I want to get  the result to show -    August 31, 2004

that is to the left of ".htm"



0
Comment
Question by:zachvaldez
  • 4
  • 3
7 Comments
 
LVL 18

Expert Comment

by:DotNetLover_Baan
Comment Utility
Hi there,

Dim Str As String = "August 31, 2004. htm"
Str = Str.SubString(0,Str.LastIndexOf("."))

Now the Str will have "August 31, 2004"

-Baan
0
 

Author Comment

by:zachvaldez
Comment Utility
So in this case scenario DotNetLover, BTW ,THanks in a  million!
                  I'd like to get only the August 31,2004 from the August 31,2004.htm
                            how is that done please..
                       dra.name here is the full filename-  August 31,2004.htm

            For Each dra In diar1
                Dim dr As DataRow = ds.Tables(0).NewRow()
                dr(0) = dra.Name
                dr(1) = "c:\Events\HTML\" & dra.Name
                ds.Tables(0).Rows.Add(dr)
            Next
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 500 total points
Comment Utility
Here you go...

            For Each dra In diar1
                Dim dr As DataRow = ds.Tables(0).NewRow()
                dr(0) = dra.Name.SubString(0,dra.Name.LastIndexOf("."))
                dr(1) = "c:\Events\HTML\" & dra.Name
                ds.Tables(0).Rows.Add(dr)
            Next

-Baan
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:zachvaldez
Comment Utility
IN this DDL, Id liek to see the first row blank so that the first data is in the second row when the selectedchanged index is fired.
thanks
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
Comment Utility
Which DDL ? Where is ur DDL ? What are you doing in the selectedIndexChanged ? Please explain...
Note:  You can always do DDL.SelectedIndex = -1   to show blank.

-Baan
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
Comment Utility
or, Insert a blank after populating the DDL:
DDL.Items.Insert(0, "--Select All--")    -OR- DDL.Items.Insert(0, "")
-Baan
0
 

Author Comment

by:zachvaldez
Comment Utility
Wow! There many ways to do it then!
Thanks for your help and I'll try each way.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now