Traverse A Concatenated String?
Jan 17, 2011
I have a concatenated string like...
str= 1010,5050,6079
And want to separate the string In Javascript I can do
string = Srt.split(","):
and the result...
string[2]=5050
Is there a way to do this in VB.NET?
View 2 Replies
ADVERTISEMENT
Aug 15, 2011
I'm suppose to end up with a label box with my name spelled out in it using string manipulation. This is suppose to happen using the concatenated string to output the name into the label box. I don't have any error codes but I also don't have my name in the label either. [code] "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. [code]
View 2 Replies
Feb 21, 2011
For my application, there is a login form in which users have the option for it to "save the login information" Kind of like MSN or other websites in which you go to a login page an the information is filled out. On my login form, I am using this code for my checkbox which is to "save login info"
Private Sub CheckBox1_CheckChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.Click
Dim s As New System.Text.StringBuilder
[Code]....
View 4 Replies
Jun 25, 2011
I am writing a tool that logs stats for a first person shooter game. The game writes its information (including who killed who with which weapon) to a log file, which I read every so many seconds and parse so that I can write that information to a database.I am now having trouble parsing the weapon out of that string of information.
Some additional information is required: a weapon in this game can contain attachments (such as a scope, a grenade launcher, etc). Weapons can have either 1 or 2 attachments. Some weapons however cannot have any attachments at all.
Each log file entry that describes a kill contains a code that describes the weapon that was used. This code is a concatenation of either 3 or 4 parts:
<weapon>_<attachment>_mp
<weapon>_<attachment1>_<attachment2>_mp
where <weapon> is a code that describes a weapon and <attachment> is another code describing the attachment.This should be easy to parse by just splitting along the underscore characters, but there's a few catches:
1. Some attachments are able to kill players as well. Specifically: grenade launchers, flame throwers and underbarrel shotguns. In this case, the attachment is listed before the weapon:
<attachment>_<weapon>_mp Note also that in this case there is always only 1 attachment.
2. The biggest catch: some weapon names have an underscore in them (some even have 3 underscores)! So simply splitting along the underscore won't work in all cases; if the weapon name contains an underscore I'm splitting the name of the weapon..This makes the list of possible combinations a lot longer. The ones I can think of (I think these are all):
[Code]...
View 10 Replies
Jul 13, 2010
I am trying to programatically create textboxes in my app. I need to do this:
dim textbox(x) as new textbox
x needs to loop 1 thru 10 but I can't get VB to accept my coding.
View 2 Replies
Jan 31, 2012
I have a dictionary that I want to access with a key that is the combination of a string (AcctNum) and a date (BalDate).It seems to me the simplest approach is to create the key by simply converting the date to a string and concatenating:MyKey = BalDate.ToString & "|" & AcctNum
I know I also have the option of creating a composite key by writing a separate class and overriding GetHashCode() and Equals() a la this solution. To me, the concatenated string is a simpler, if somewhat less elegant, solution. Am I missing some compelling reason why I should go with the composite key class approach?
This lookup is the crux of the project I am working on, so performance is my main objective (with readability a close second).
View 2 Replies
Dec 8, 2009
I'm creating a text box with auto-suggested. So, it works well. It suggests only first name, but I want it to suggest the full name (first and last name which two different columns). Take a look at the following code behind that worked as expected :
[Code]....
View 1 Replies
Apr 27, 2012
I figure I should use 'Aggregate' but apparently I am getting it wrong First I get a list of my Entity objects Dim employers As List(Of myEntity) = (New XXXX()).getZZZ(userName, userType) Then I figured this would be a way to put all the names in a string Dim names as String = employers.Aggregate(Function(current, [next]) current.Name & " " & [next].Name)
[Code]....
View 2 Replies
Aug 15, 2009
I need step-by-step help in getting a creating a dataset of a single table. I'm able to connect to my SQL2005 server (residing on same machine as code for lack of equipment) [code]...
View 3 Replies
Mar 4, 2009
im working on windows application.In this Application iam using two forms one form is for save and modifying the details of the Patient. This First form contains a 'Find Patient' Button .when we click on button. new form will be open code in the 'Find Patient' button click
'open a form2 from form1
dim f2 as new form2
f2.show
In this form2 iam searching for particular patient according to their Id and retrieveing all the details of the patient in a datagridview wat i have to do is when i click on any cell in datagridview of a particular employee . the details of the particular employee should be shown on the first form1 by hiding this second form2'code in the datagridview_celldoubleclick()
Private Sub grv_Patientdetails_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grv_Patientdetails.CellDoubleClick
Try
[code].....
data will be retreiveing correctly. but it is opening in a new form but already old form1 is opened beneath the form2 ? new form should not be opened and data should be retrieved in the first form which is already opened how should i do this?
View 1 Replies
Feb 18, 2010
I have a VB class inside which one of the methods accepts an array of forms. For each form inside the array, I need it to traverse all of the objects, check if they are a specific tyoe (input, label, checkbox, etc.) and get the properties of each object. Then, I want to dump these into a text file in the following format:
[Code]...
View 4 Replies
Sep 28, 2011
how to traverse all TableAdapter in xsd file?
I want to change default connectionstring of all TableAdapter objects in xsd at beginning of application,
View 1 Replies
Nov 2, 2009
Im wondering why this doesn't work: It sets initialdirectory to directorypath and doesn't traverse into save folder. I've tried it all. Anyone have any ideas of how to get it to work? [Code]
View 4 Replies
Jun 3, 2011
My code is:
sqlsub = "SELECT distinct field1, field2"
sqlsub += " FROM tbl I
Dim da As OleDbDataAdapter
Dim lsdataset As New DataSet
[code].....
My prob is how should I bind the combo with field1+"("+ thpr+ ")" thpr is the string i get from function by passing field value 2 from query my combobox should be displayed as field1 + (thpr).
View 1 Replies
Aug 6, 2009
Following code sample should concatenate the value. Concatenated value has to be assigned to variable AlphaStr. But result is always null in the variable AlphaStr.
[Code]...
View 4 Replies
Jun 2, 2011
How do I display the concatenated records in my combobox? I have the following codes
Private Sub frmAssignSubjects_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If cnn.State = ConnectionState.Closed Then cnn.Open()
If rdoHS.Checked = True Then
[code].....
What should I put in the DisplayMember and ValueMember? If I will not concatenation, I just use "LastName" and "IDNO" in my DisplayMember and ValueMember respectively then records get to display in my combo.
View 13 Replies
Jan 31, 2011
MY TABLE
sample comment1
sample comment2
[CODE]...
if sample column value is the same, i want all comments value to be concatenated
do while dr.read
listbox1.items.add(dr.getstring(0))
[CODE]...
View 2 Replies
Apr 2, 2011
I need to sort the values of my listbox to have the latest date on top plus some text. here is the code I'm using:
[Code]...
View 4 Replies
Apr 10, 2011
What is the command for showing Windows Explorer in VB 2010? In VBA it is: Application.GetOpenFilename.
View 5 Replies
Jan 18, 2011
Can I do anything more or less with IDictionary? How do these two collections differ?
View 5 Replies
Mar 11, 2010
my code is :
[Code]...
The error is Value of type '1-dimensional array of string' cannot be converted to 'String'.
View 2 Replies
Jul 29, 2011
I want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.
[Code]...
View 2 Replies
Aug 12, 2011
Basically I have a webresponse stream:dim lol as string = readstream.tostring there is a lot of information within the string but only one link starting with http: located near the end of the string - however there is no constant character point where I can start... (i.e. 38)
I want to extract the link from the string i.e. dog cat plane car [URL]..that is approximately how it looks above - words and url substituted I want to just extract [URL]..I had an idea of parsing the string from http: to the end Then after that splitting the string up again to remove the }], however it does not return anything
View 3 Replies
Jun 22, 2010
I got an app, which receives data via a R232 port, convert it to a string and on the other side I got a database, where the strings are saved. How can I find a way to compare the string with all strings in one database column and get back the another stringform the same row in this database. I never programmed a database
View 1 Replies
Aug 18, 2011
I have buttons generated through code (dynamically). I have to associate an event (the same) to them. I use AddHandler button.click, AddressOf mysub.The issue is that mysub gets a string (mysub(string)), but AddressOf doesn't accept a parameter inside the routine. How can I do this? Using also an alternative to AddressOf.
EDIT:
Public Class Form1
...
Private Sub mysub(ByVal sender As Object, ByVal e As System.EventArgs, ByVal str As String)[code]......
View 2 Replies
Dec 5, 2011
These is the content of my txt file which is saved in D drive in my pc abc,1,2,3..I tried the flowing but it didn't work:[code]I am getting error on this line.. data = line.Split(","c)...it says this line isn't in use anymore or something and that I rather use LineInput but thats asks for filenumber and i don't know what that is. I am sorry but I am a complete beginner. what else can I try? [code]ok that error is gone now but now if I want to add these values to a list box..how can i do that?
View 1 Replies
Jan 7, 2010
What is the best way to pass the four (4) parameters after the applicationName to the application to be launched?
Process.Start ("C:\MyApp.exe",
"CommChannel1",
"DeviceName",
"Language",
"UserName")
View 7 Replies
Jun 23, 2009
I have the following web method:
<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=True, XmlSerializeString:=True)> _
[Code].....
I wanted to use HttpGet here so that the result can be cached.
I tried every variation of calling this, but no luck. Is this possible with GET?
View 2 Replies
Apr 5, 2011
I have a field that I display via: String.Format({0:c},amount) This produces the string "$28.28" However, when I try to convert back to a decimal amount, I get an incorrect format exception: amount = Decimal.Parse(amount.Text, NumberStyles.Currency) I also tried it with NumberStyles.AllowCurrencySymbol with the same results. I verified that the value in amount.Text is "$28.28". Am I missing something? Shouldn't these two operations use the same currency symbol and formats?
View 2 Replies
Sep 24, 2009
I Ported this code from a code project article in c# called Nscript
heres the code
Base App
Imports System
Imports System.IO
Imports System.Resources
[code]....
Okay Now I only get two errors (I dont know how to solve them)
Error3Class 'BaseApp' must implement 'Sub OnCompilerError(errors() As CompilerError)' for interface 'IScriptManagerCallback'.
And
Error4Class 'ScriptManager' must implement 'Sub CompileAndExecuteFile(file As String, args() As String, callback As IScriptManagerCallback)' for interface 'IScriptManager'.
But What I would also Like to know (as well as how to fix the errors), is would the code work?
View 1 Replies