Removing Characters Off The End Of A String?
Jun 5, 2009lbltime.Text.Replace(lbltime.Text, lbltime.Text.Length - 2)That does nothing, no error but it doesnt remove the last 2 characters from the string.
View 8 Replieslbltime.Text.Replace(lbltime.Text, lbltime.Text.Length - 2)That does nothing, no error but it doesnt remove the last 2 characters from the string.
View 8 RepliesWhen I try to remove the last few characters of a string, I get an index out of range error. I am using the following to remove the characters from the end of the string:
objJSONStringBuilder.Remove(objJSONStringBuilder.Length - 1, 6)
The string has <hr /> at the end which I want to remove.
Removing the first 8 characters from a text string. How can I do it?
View 6 RepliesI need to parse an alphanumeric string leaving the characters "0-9", ".", "/" and space & remove everything else. I use "[^0-9./ ]" as my regex string and it works well. But now I have a couple other conditions that I dont know how to handle with my regex string. I actually only want to keep the "." character if it falls between two digit characters (ie. 3.5), otherwise remove it. And also I need to replace any "-" characters with a space if it falls between two digit characters (ie. 2-1), otherwise remove it.
View 1 RepliesIf I want to remove 2 characters, or a specific letter or character from a string in VB, how would I accomplish this?
A usual input would be
"63.0" in string format
and I want it to be
"63"
I have a situation where a user can enter just about anything they want into a text box.Whatever they enter in the box, I need to split the string into an array of strings where each item is one word. For example, if the user enters All State Insurance, I split that into a string array:
sParams(0) = "All"
sParams(1) = "State"
sParams(2) = "Insurance"
[code]....
Essentially I am trying to replicate the Windows 7 (In-Windows) activation key TextBox form. The Form where it will auto capitalize letters, remove or deny all non alphanumeric characters except dashes every 5 characters that will be auto-input.I assume this can be done with a fairly complicated replacement Regular Expression but I cannot seem to create one to fit the needs.
This is an Example of what I have right now, but it creates an infinite loop as it removes all characters including dashes, than adds a dash, which changes the text and removes the dash again.
[Code]...
Currently I have a class that checks for apostrophes and doubles them up like this
Shared Function CheckForBadCharacters(ByVal MyString As String)
Dim finalstring As String = MyString
finalstring = Replace(finalstring, "'", "''")
Return finalstring
End Function
Works fine, of course i need to reverse this when retrieving - however is there a better way ?
[Code]...
I have a word that O want to alter. The words are numeric:123457I want to use the first two numbers and the last number. In this case it is 12 and 7.
View 2 RepliesI have a string of characters, but I would like to have a string of hexdecimal characters where the hexadecimal characters are converted by turning the original characters into integers and then those integers into hexadecimal characters. How do I do that?
View 3 RepliesI am using a collection to store data from a text file which I am letting the user load and I am using the .split to split and sort the data into alphabetical order and remove repeating words.However, I am having a problem removing unwanted characters from the final array. For Example, "This is the text file that I want sorted. It is random text not yet sorted"
View 6 RepliesI have a program that re-sizes items in an array but I can't get it to work. I have:
[Code]...
It gets to the Remove but it just doesn't delete the characters from the string.
I have recently developed a serial port communication program to access my hardware firewall and its connected to the device via a converter usb to rs232head plugged to a rs232 to an ethernet cable. this ethernet cable then plugs into the device console port.
my program functions similar to that of TeraTerm. an opensource hyperterminal program written in C++ but i decided to do one for vb.net
Alright to cut the story short, i have successfully coded out the program to accept incomming data from the device but however, i'm also receiving ansi escape sequence along with it and i have no idea how i could implement codes to remove these. i have spend 3 weeks trying to look for vt100 emulation codes written in vb.net but i found none so far. most are written in c++. here's an image to illustrate the problem which im facing.
The image below is a screenshot taken when the i ran both the programs together. The bottom is tera term 3.1 and the top is my vb project which i made using msdn's example and improved on the codes. basically tera term was able to interpret those escape sequence and display accordingly to that of the vt100 terminal display. I have spent time reading on regular expressions using the inbuilt function regex in visual basic and tried parsing some strings but its not working. i guess its far more complex than i thought.
i have been trying to remove special characters. i am not able to remove many crlf in middile of the string.
View 3 RepliesI need to create a console program that allows you to enter a string, of which is then outputted in reverse.
Sample:
Input: Diewas
Output: saweiD
Apparently I need to find out about strings and will also need to use a loop.
Not sure if too many people know this, but the following line will cause an error:
GroupName.Substring(0, 3) = "jt_"
....if the length of GroupName is less than 3 characters. I always thought it would simply return whatever characters in GroupName, but no, it errors. I must be thinking of the old VB6 days.So, I now have to change the code to:
If (GroupName.Length > 2) Then
If (GroupName.Substring(0, 3) = "jt_") Then
Note that the two comparisons need to be on separate lines. If they are on the same line, such as:
If (GroupName.Length > 2) and (GroupName.Substring(0, 3) = "jt_") Then then the code will still fail as the length command is executed at the same time as the substring command- which will cause the error when the GroupName length is less than 3.Just thought that those of us not aware of this should be!
dp.SyntaxHighlighter.ClipboardSwf = '/dp.SyntaxHighlighter/Scripts/clipboard.swf'
dp.SyntaxHighlighter.HighlightAll('9844f9bfb55449e6a786fa62aaadfa20')
dp.SyntaxHighlighter.HighlightAll('f6d554fd98464bdba9159b319e51b381')
dp.SyntaxHighlighter.HighlightAll('93bf4ca63ad8447abdf084d8a9991e15')
I'm having a variable, which contains characters with tab character in between two words. remove the Tab character.
For Ex;
Input string "Word<tab>1234"
I need the output as "Word1234"
0000011 22 331. How do I remove "22"?2. How do I get "0000011" and "33"?
View 1 Repliesi tried to read html contents by striping html tags in a string.when i try to print that string i got - character. how to remove this character?
View 2 RepliesIs there any function in vb.net that removes all spaces in a string. I mean a string like ' What is this' should be 'Whatisthis'
View 3 RepliesI had a quick question. I'm desiging a program that users can enter a currency (dollar amount) in a textbox. Since the string I declared will be based on what the user typed in and I want to convert it to a decimal, I want to remove a "$" sign if the user made one.
View 4 RepliesI have an object folder, which has an atributte name path, that contains a string with it's current path, say "folder1folder2folder3"
I need to remove the last ocurrence beginning on the last "" (in this case, 'folder3'). The new string would be "folder1folder2"
I have two a strings when i use them in msgbox() i get this
View 6 RepliesI'm trying remove non-letters from this string I have. I have an order form for hats and T-shirts, they select everything and click on buy button there order info shows up in a listbox. For the results in the listbox I break down there order info and show there total price. Well the string I have for the sizes comes up with Medium "7 1/8 - 7 1/4" in the list box. I want to remove non-letters and have it just show "Medium". I try using the instr function and the trim function as well but nothing is happening.
View 1 RepliesAlright I am taking an XML file which has a bunch of tags and I'm trying to eliminate everything but whats inbetween certian tags for instance the input maybe
- <w:p w:rsidR="00254C13" w:rsidRDefault="001173CF" w:rsidP="001173CF">
- <w:pPr>
- <w:tabs>
[Code].....
unless they say they are safe. Average consumer can protect themselves>not knowledgeable enough to always protect selves</w:t> I want to go through and remove those end tags but when i used the remove string it didn't let me specify a string to remove it the two arguments were where to start and how long. how do i specify what to remove?
I have a string that has three spaces in it.
In the following examples, underscores represent the spaces:
Quote:
_x-xx-xxxx_x.xx.xx_xx
I need to remove just the first space. Now, i tried just replacing the space with nothing, like so:
VB.NET
If s.Contains(" ") Thens = s.Replace(" ", "")End If
But, that removes every space. I also tried .StartsWith, but it still removed every space. I didn't actually expect that to work, but if I hadn't tried it, I wouldn't have actually know.
how to remove just that first space?
I have written a program that uses an array of the english alphabet and Morse code. I also built a form with a input box for the alphabetic information and an output box with the Morse Code. What i am trying to do is basically type a word like "Hi" in the input box and produce the Morse Code equivalent in the Morse Code output box. [Code] This works but only one letter at a time. Do i need to Parse the string of characters one at a time, and then run it through a loop like i have created?
View 6 RepliesI need to be able to pull a list of reference from a database whixh ar 12 characters long. Unfortunatley i dont want the first character from each reference number as it is useless but just has to be there.
anyway of saying "list refernce numbers, not including the first character"?
If I have a string like: (240). Is their a easy way to strip out the "(" and ")" so that I am left with 240?
View 3 Repliesprogram makes strings from webbrowser documenttext.For example
String1 = "<span class""long-title"" title"" Informations here"
Im trying to remove all text before "Informations here" this is what i currently have.
dim mychar as char () = {"<"c, "s"c, "p"c, "a"c, '....thatandlike20moretill.... "e"c, """"c}
string1 = string1.TrimStart(mychar)
(Note that each letter or symbol inbetween the quotations is a part of the string (span = "s" "p"...)Now this works. Not all the time though and its a pain in the .. having to do "letter"c, all the time.. (I got over 10 strings lol) Im wondering if theres a way easier method to remove part of string from the beginning, maybe like still a certen part of the length..