VB 6 And 2008 Strings?
Nov 22, 2009
im wounder how to make a string error like that in vb so if the user write echi and not echo on a string it will get a error like a other variant of this if richtextbox1.text = ("ecoi") then msgbox("string error") but only on 1 string
View 3 Replies
ADVERTISEMENT
Aug 13, 2009
I am working on a UDP Client/Server, and currently i have them sending back and forth strings, which i convert to bytes, and then open the bytes to read. I want to now send an Object instead of those strings, which includes multiple unsigned integers and strings.
View 39 Replies
Oct 16, 2009
I'm migrating from VB6 to VB.NET, in hence my questions below:
I have to write a function that returns array of strings.
How can I initiate it to empty array? I need it since I have to check if it's empty array after it returns from this function.
Is list of arrays better for this purpose? If I use a list - Is it empty when it firstly defined? How can I check it it's empty?
View 3 Replies
Oct 16, 2009
Say I have a List(Of Tag) with Tag being an object. One member of Tag, Tag.Description, is a string, and I want to make a comma-separated concatenation of the Description members.Is there an easier way to do this than to read the Description members into a List(Of String) and then use the Join function?
View 2 Replies
Aug 5, 2010
I have a list of strings. For each string in that list, I want to prepend another string. I wrote a method to do it, but I was wondering if there was something already in .NET I could use to do this. It seems like something that could be built in, but I was not able to find anything.
Here is the method I wrote:
Private Function PrependToAllInList(ByRef inputList As List(Of String), ByRef prependString As String) As List(Of String)
Dim returnList As List(Of String) = New List(Of String)
For Each inputString As String In inputList
returnList.Add(String.Format("{0}{1}", prependString, inputString))
[code].....
It works, but I would rather use built in functions whenever possible.
View 5 Replies
Aug 17, 2010
I'm going to start a project so what I need to do is make something that is kinda like an email. I am working with the register part of it because just like an email you have to select who to send it to.
View 5 Replies
Feb 1, 2011
I read a text file and I want to make some changes and still save it as a text file.The change is to add color to some strings. How to do it?
1 2 3
3 4 5
4 5 7
Then
1 2 3
3 4 5
4 5 7
View 7 Replies
Apr 27, 2009
I have been summoned with the task of taking a tab delimited file and converting that file so it can be read by a third-party program. I am trying to think of the best way to do this, but I am having a hard time. Here is a view of the raw data that must be altered:
fkstoreidHeaderMarkB1RegNodateofbusinessNoRegEntriesTipsOverRingsVoids$Voids#NetSalesDP1_2GuestsDP3GuestsDP4GuestsDetailMarkfkdaypartidRecTypeGLB2Sales
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D2041005NULL2220.25
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D3041005NULL9170.19
1061HNULL101/01/2008NULLNULLNULL113.263512785.4714453137D4041005NULL670.75
[Code]...
I am toiling with the best way of doing this. So far, I am not having much luck. I have used arrays quite successfully in Java, but I am not sure that this is the best way to go here. I would have to get how many lines there are and read each line. Make the changes, and then go on to the next line. I think scanning the document line by line using a loop is the best way. However, I am not sure.
View 4 Replies
Aug 10, 2009
Hopefully this question will have an easy answer; I've tried searching for the answer myself, but I don't know what to search for (I don't know what you would call this).
Is there a way to compare a string to see if it matches more than 1 value?
[Code]...
View 6 Replies
Aug 30, 2010
I have a database of tables that I needed to do some comparison work on and sql server is limited to the means of doing string comparisons. I put all the data into lists and thought of using [URL] or string.contains but does not seem like it is working right. It is large amount of data and I need to be able to make some matches in order to avoid the manual checking of each string. Here is sample data and code;
[Code]...
View 1 Replies
Apr 2, 2009
I'm not sure of the name of the function i'm after but im trying to turn:
http://
into
http%3A%2F%2F
for example, is there a function i can use for this at all? i'm not to sure what to search .
View 3 Replies
Apr 1, 2009
I need to make sure that a certain textbox only allows dates to be entered under a certain format EG: DD/MM/YYYY
View 8 Replies
Apr 12, 2010
I once again feel so angry about VB .NET . Here's what ruined my day :Lets say we have have a string variable :
Dim Var1 As String = "blablabla"
If we want to replace something within it , we can use the Replace function :
Dim Var2 As String = Replace(Var1,"a","o")
This works great . My problem appears when I want to replace the " character (double quote) . Thus , when using :Dim Var2 As String = Replace(Var1,"""","o")it will return an error .Of course you may wonder why I care to replace the " character . You see this string variable receives its value from a text box . Thus , if the user uses the " character , I want to replace it with two ' characters (single quote) . Is this replacement possible in .NET
View 4 Replies
May 17, 2010
I am trying to write an app which allows the user to input two times , in a maskedtextbox, and take those two times and add them together then output the result to a third maskedtestbox, I havent seen anything else on the web with the same problem, only with fixed date or time, nothing that the user can change.
I am guessing you have to input the a maskedtextbox as a string then parse them to datetime, add the two together and the convert the date back to a string at runtime my code always bails out with a datetime conversion
[Code]...
View 9 Replies
Oct 4, 2011
I have tried this:
If TextBox1.Text.Contains("example1" And "example2") Then
And
If TextBox1.Text.Contains("example1" And "example2") = True Then
[code].....
View 9 Replies
Sep 27, 2009
When i save data in my xml file i save a bunch of cities that the user has selected, i then proceed to load the data back into the program and populate the check fields besides the city
vb.net
'// Loop through each one and re-check them
For Each cityToCheck As Xml.XmlNode In nodeList
[code]....
This string stringSplit(0).tostring returns the city name say "Glasgow" i was trying to loop the listview that stores the cities, if they match then put a check mark, this is where the cities are located: (formAddCities.listViewCities.(FIRST ITEM IN COLUMN WHICH IS CITY NAME) the very first column in the listview, but i can't seem to get the right syntax?
View 2 Replies
Aug 28, 2009
If I were to execute five different SQL-commands, wich of these way would be the best/most effecient?
Dim sql(4) As String
sql(0) = "SQL-string 1"
sql(1) = "SQL-string 2"
sql(2) = "SQL-string 3"
sql(3) = "SQL-string 4"
sql(4) = "SQL-string 5"
[Code]...
View 16 Replies
Feb 4, 2010
q1/ how can i convert a lowercase string to sentence case with LINQ, without losing my rtb formatting?
View 2 Replies
Feb 15, 2010
I have the html of a page loaded into a string.
confirmUse('??????','Eat'
I want to extract the number that the ?'s represent however confirmUse is used in other parts of the page. The only constant is the 'Eat' which is unique to this specific number.
I usually use Mid and Instr to find what I need but when I try to back track it gives me an error because the index number is below 0.
View 2 Replies
Mar 27, 2009
Basically what i want to do is when a command button is clicked and it has run the code at then end i want a label to display one string out of many at random. How would i declare the various strings and then get it to display one at radnom
View 7 Replies
Jun 5, 2010
im trying to read "calculator" from calc.exe, now i found the mem adress where the value resides but i have a few problems
1) how many bytes should i read? im not just talking about calculator string but potentially any length string, i get different results with 4/8 bytes but same from 8 - 32 bytes
2) when i read i get a long value 27866486557179971 but how to convert that into a string
EDIT: ok by staring at the return value long enough i discovered that when i convert it to hex it spells "calc" backwards, same for all other strings, i could build a working converter based on that knowledge but now what bugs me is where is "ulator" or the rest of the string, the most i can get is always 4 letters
EDIT2: oh nm that, by moving memory adress a step further i get the next letter along with 3 previous ones and still backwards but i can work with that
ok so now next step would be making a search function for which i need to find out the range of memory to scan, anybody know how to do that?
View 5 Replies
Aug 25, 2011
i have a multiline textbox and it add a load of info to it.
What i need is for it to remove all strings befor the : char.
For example if the line was this: this is just an example : hi there how are you ?
it would remove all befor the : and be left with: hi how are you ?
View 15 Replies
Oct 22, 2009
Alright i have 3 strings in a class1.vb. In form1 it will put in a text. In form2 it will read the 3 strings and print them on 3 textbox
View 1 Replies
Mar 13, 2011
I recently had to use my "String converter" to convert 20 lines of text to a single line of "VB .Net String coding". For example:
This is line one
This is line two
This is line three "with extra stuff"
[Code]...
"This is line one" & vbCrLf & "This is line two" & vbCrLf & "This is line three " & chr(34) & "with extra stuff" & chr(34) & vbCrLf & vbCrLf & "Empty line above me"What is the best way to represent these types of Strings? For example, if you have to display a long message or just a label with information that changes.I was thinking of some sort of text file collection, but it is a little useless to have 100 text files of information of 5-6 lines.
View 13 Replies
Mar 8, 2009
I have the following
Dim input As String
If e.KeyCode = Keys.Enter Then
[code].....
View 6 Replies
Jan 9, 2009
i'm currently trying to make a connection between my phone to my PC using vb .net and a program I will build for my phone.my phone should send information (some strings) through the com port, I wrote in google "VB .net bluetooth" and I sew there is a library for vb .net, but I don't think I need that library, can I communicate with a com port without this library? like making a connection with a normal com port?If I'm right, how do I do that? how can I recieve information from the bluetooth com port?
View 7 Replies
Jan 30, 2009
I've got a bunch of tag's that look like this
Quote:
?Me.CapabiltiesTreeView.SelectedNode.Tag.ToString
"VendorId=1 and Capability='Translation' and LanguageFrom='English' and
[code]....
View 5 Replies
Feb 10, 2009
I need to read strings by stream! Is this possible? I've been searching for quite a while now, without results.So what i have is an application which gets song lyrics. The lyrics come in a string and i need to separate the string into multiple lines. Just to make that clear, lets say that im getting this text and put it into a string:
Bla bla bla..
Na nana na
And in string format = "Bla bla bla... Na nana na" but what i need to do is separate them into its original, line by line.I created an for each loop which looked for upper chars and when found, create a new line. But that didn't work out so well since the lyrics are written in proper english, using the upper "I" everywhere. So i created a new loop which ignored "I":es if they were followed by a space/blank " ". That didn't work either, it skipped some sentences.
View 8 Replies
Mar 31, 2010
How to Converting numbers into formatted strings in VB 2008 Like
Dim
fmtstring =
End If
"#,###,###,##0.00"fmtstring As String
NumberFormat=Format(s, fmtstring)
How to do such Formatted Formats in VB2008.
View 2 Replies
Feb 23, 2010
How to get letters from one word into strings (one letter, one string).
View 10 Replies