Get String Between 2 Values?
Mar 24, 2009
I have a public function that i use quite a lot in the program that im making, that takes a string in-between 2 values:
Public Function GetStringBetween(ByVal InputText As String, _
ByVal starttext As String, _
ByVal endtext As String)
[code]......
View 2 Replies
ADVERTISEMENT
Sep 20, 2009
my goal was to have a string generator that runs through all possible values of a string eg.
Possible values:
abcd
Chars that need to be filled:
**
Outcome:
aa
ab
ac
[code]....
(I have cut out a section where it tries to write it to a doc file. (just the writting))What I was wondering is how would I improve several parts of this code?
1. The speed - Already In a background worker (I will write a delegate soon )
2. The chars that can be used with it because this only allows the preset ones I would like to be able to use other ones like � or Chinese chars etc.
3. general Code.
View 2 Replies
Feb 3, 2012
I am trying to use string.format on a url to pass several values into the string. It's probably a simple error but I cannot get the following code to work. It doesn't even build the string.
Public Sub getStockData()
Dim client As New WebClient()
Dim url As String
[code]....
View 1 Replies
Jun 10, 2011
I am trying to get input from user then convert it into specific format and hold it in new variable. here is my code
[Code]...
View 4 Replies
Nov 26, 2010
working on user input box , get any value as string and format it as 0000xx here is my code, but value not passing.
Dim dtmInputBox As String = ""
Dim strDTM As String
Do Until Not dtmInputBox = Nothing
[code]....
my input is like 20 and i want to get as 000020
View 4 Replies
Oct 18, 2010
What would be the fasted method of get a string list of all values within [] in a string of text? For example: [client_name], are you are doing today? My name is [my_name]. The list of strings would be:
[Code]...
View 6 Replies
Feb 23, 2009
I have tried just about every format I have found, and I can not seem to get the string digits 0-9 to show up as "00 - 09". Now I do not want numbers 10+ to show up as 010, 011, etc. I also know there are (2) ways to format strings as well:Microsoft.VisualBasic.FormatandString.FormatI have tried all of the following with no[code]...
View 2 Replies
Jun 9, 2012
I doing a project for my office. In that I am showing the values and strings from a particular table based on the date range and vendor selection. It is working fine with the date range. Except within the date range if the particular reader has no data it throws an error message like dbnull string.
[Code]...
View 8 Replies
Dec 18, 2011
Lets say I have a string that could look like this[code]...
I want to break each of those in to two strings. The break point would be two decimal places to the left of the existing decimal point. So in the first example I would end up with 123 and 07.37 and the second example I would end up with 44 and 01.0. I assume I need to use a form of .indexof("."), but I cant figure it out.
View 2 Replies
Nov 13, 2009
How can i compare two string values in vb.net? i've tried compare, equals functions but it's not giving me the correct result. what i'm trying to compare is as follows. also let me know if the code is correct. i'm new to vb.net
[code]...
View 3 Replies
Jan 14, 2009
This is in VB2008 Express
I have a Data Connection set to my Access file. I an connect fine and run queries and whatnot. When I close VB 2008 and re-open the project it won't connect to the Database again. It loses the password for my Workspace for some reason. There is no option to save the password, but it doesn't lose any of the other information in the connection string.
View 2 Replies
Jul 22, 2011
Using VB.Net, I need to read the following XML from a string variable (not a file) and pull the AuthNo, Client ID, Client Name, Supplier ID, and Supplier Name for each Dispatch contained within the XML.
I have looked at tons of examples on the web using XMLReader but I can't figure out how to pull the separate ID's and match them up with their appropriate Names and also matched up with appropriate AuthNo.[code]...
View 7 Replies
Mar 6, 2009
is my string that return the value, dim strID as string="2343-dsds3-65gff".if the values in all the strID are zero,i.e.,strID as string="0000-00000-00000". i want to display error.
View 2 Replies
Nov 28, 2010
I am trying to verify that a string contains nothing but known values. In this case, I need to make sure it contains only "Shift", "Control", or "Alt", but not necessarily all of those. For example, these should be true: "Shift + P", "Shift + Control + H", "Alt + U; but these should not: "Other + P", "Shift + Fake + Y", "Unknown + Shift + E" etc.This is the code I tried to use:
If Not shortcut.Contains("Shift") Or Not shortcut.Contains("Control") Or Not shortcut.Contains("Alt") Then
MessageBox.Show("Invalid")
End If
I'm having difficulty wrapping my head around the needed logic to do this. I'm assuming there's a logic operator that can do this?
View 2 Replies
Jun 13, 2011
Looking for the simplest way to extract values from a string. For example consider the following:Dim args As String = "/firstname:Bob /lastname:Jones"..To simplify, I need to be able to popup a box that says "Firstname = Bob" or "Lastname = Jones"
View 2 Replies
Jan 14, 2011
i have a string = "/a/value1/x/valueforx/b/value2/c/value3"
the keys a, b, and c can be in any order in the string that is coming in and will always be separated by a slash.
What i need to do is to find a, b, c and then add their values to a collection
View 5 Replies
Jan 24, 2010
I am very new to VB, and am programming in VB 2008 express. Sorry if this thread is in the wrong spot I need to add two 40 digit numbers together and was thinking that the simplest way to do it would be to input them as a string and then convert the string to a single dimensional array where x(1) is the 1st digit in the number, and x(30) is the 30th digit, etc. I would do the same for the other number where y(1) is the 1st digit. I would then add the x(40) and y(40) (which are the last digits of the number) together and carry the remainder into the next addition (39th digit, 38, ...)
[Code]...
View 4 Replies
Jan 18, 2010
I have a tblVersion that contains the versions of my application:
VersionID Version
VersionID is a bigint primary key, version is a ntext column that holds the current version... I want to be able to pick the row that has the highest version number, but version could be in this format:
MyApplication 1.0.1
If I try to convert that to a int32 it will throw an exception obviously. I would like to know if some of you have a idea how to solve this issue. I could of course make sure the column will only contain numeric values but this gives a little more flexibility.
View 4 Replies
May 19, 2012
This code I converted VB to C#. But i need to know how can use Hex in c#
private string ConvertStringToHex(string sText) {
int lCount;
string sHex;
string sResult;
for (lCount = 1; (lCount <= sText.Length); lCount++) {
[Code] .....
View 1 Replies
Apr 20, 2010
I have a ListView control set up in details mode, and on a button press I would like to retrieve all column values from that row in the ListView.This is my code so far:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim items As ListView.SelectedListViewItemCollection = _
[code].....
View 2 Replies
Aug 2, 2011
I need some thought input on how I can take my string of HEX values and convert them to ASCII according to the specifications below: A function would be ideal since I need to quickly decode about 250 records all having 20 thresholds to record.[code]
View 14 Replies
Oct 21, 2011
I have a simple query but I am just not able to get it right. Have a look at my sample code below:
Sub Function1
My Code Here
Function2(Year,Month)
End Sub
Sub Function2(Year,Month)
Dim Str as String()
for 1 to 30
Dim MyDate As New Date(Year, Month, i)
Str = MyDate.DayOfWeek.ToString()
Next
Return Str
End Sub
View 7 Replies
May 31, 2009
I am trying to insert some values into my database using the sql string below:
"INSERT INTO Users" & "(Username, Password)VALUES " & "('" & Accounts.TextBox1.Text & "'," & "'" & Accounts.TextBox2.Text & "')" The error message reads: "Syntax error in INSERT INTO statement."
View 4 Replies
May 20, 2010
I am having a string in CSV format.http:[code].....I can add new values to it by some mechanism. Everything will be same except the new values will have numeric part = 0. Take example I have this exsiting CSV string
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt
Now by some mechanism i added two more files Superman.txt and Spiderman.txt to the existing string. Now it became
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt, 0, Superman.txt, 0 , Spiderman.txt
What i am doing here is that this csv string is paased into SP where its splitted and inserted to db. So for inserting I have to take the files with numeric part 0 only rest will be omiited .Which will be further then converted into CSV string.Array will look like this
str[0]="1"
str[1]="abc.txt"
str[2]="2"[code].....
So at last i want to say my input will be
1 , abc.txt , 2 , def.doc , 3 , flyaway.txt, 0, Superman.txt, 0 , Spiderman.txt
Desired Output:
0, Superman.txt, 0 , Spiderman.txt
View 1 Replies
Apr 30, 2010
I have a application that I would like to pass the company name to the other application?
View 1 Replies
Jun 10, 2011
I would like to read values set in a string that's retrieved from the Web, I've already got the string in a string called Webdata.The string is like so...
"Info" {
"Name" {
"Name1""Value1"
[code]....
I need to set Value1, Value2, Value3 as strings that I can use.
View 2 Replies
Aug 4, 2010
i have a string which is a paragraph written on the aspx side. So its goes like this.
The new student, {student_name} has the following grades -
Maths - {math_grade}
Science - {Science_grade}
[code].....
View 3 Replies
Mar 17, 2009
im trying to figure out how to edit this program and have it save values as a string or array and allow them to be recalled and edited however im at a terrible slup, here is the code im going to base it off of.
Public Class frmHospitalCharges
Dim introomcharge As Integer
Dim decmisccharge As Decimal
[Code].....
i have the basic program written i have to add a input box for names.
View 2 Replies
Jun 26, 2009
I have a program which grabs the source code of a webpage and puts it into a string. I would now like to search the string for two values.
"video_id": "value 1 here"
"t": "value 2 here"
The problem, is that I don't know the position of the values, and I the values change depending on each webpage. All I know, is the text before the value, e.g. "video_id" and "t:"
Here is my code:
Dim videoid As String = TextBox1.Text.Trim
Dim wc As New System.Net.WebClient()
Dim result As String = wc.DownloadString(videoid)
View 7 Replies
Apr 3, 2011
I need to sort the values of my listbox to have the latest date on top plus some text
I used a reference I found here on the forum but I can't get it to work properly.[code]...
View 2 Replies