String Replace Result As "0101000" Form The Given Input "2,4,11,17"?
Jun 18, 2012I am having string "2,4,11,17"and want output as "01010000001000001000"How do I achieve it? using LINQ
View 1 RepliesI am having string "2,4,11,17"and want output as "01010000001000001000"How do I achieve it? using LINQ
View 1 Repliesthe coding is to 'Get input string and put its character into List, and replace the character with other.'but having problem putting each character into List and also replacing it,[code]
View 2 RepliesI have set up a method in vb.net and in xcode for encrypting a string using as far as i can tell the same parameters for an AES encryption.I've looked all over the place but cannot find information on whether they use the same encryption algorithm and settings.
this is the vb.net code:
Dim encryptAES As New AesCryptoServiceProvider()
Dim encoding As New UTF8Encoding()
Dim encryptor As ICryptoTransform
encryptAES.Key = encoding.GetBytes("12345678901234567890123456789032")
encryptAES.IV = encoding.GetBytes("1234567890123416")
encryptAES.Mode = CipherMode.CBC
[Code]...
I am trying to create a program that is able to submit post data for the page [URL] where it submits the request fields and then the resulting page is receiving in a string.
View 2 Repliesim making a program where the user inputs a string into textbox 1 so like "Hello goose".And when they press button1, i want text box2 to get the textbox1 input and replace every instance of the letter "e" with the string "%65" and print it out on textbox 2.
View 2 RepliesThe file reads in parameters and two of the parameters used to be in Date Format YYYYMMDD but will now permanently be in format YYYY-MM-DD. This change, I believe, is stopping the import of the file from working. I would like to replace the new format YYYY-MM-DD back to YYYYMMDD in the code. If possible I'd also like to see some output so I know that the old format has been replaced with the new format. The code is below. I added the two rows with .replace code in green in expecting that to be enough but it is still not working.
Public
Sub Main()
Dim R1, O1, P1, C1, strDateFrom, strDateTo, strRunDate
As
String
[CODE]...
I would like to allow my users to decide where they want their data to reside. I have created a data source which is referenced by crystal reports. I would like to replace the |DataDirectory| to point to a path the user selects. or if possible substitute it with vb function.
Below is the line in xml that point to my db. I would like to allow it to call a vb function that will return my db path I am not sure how to replace the connection string by using a vb function in xml.
<Connection ConnectionStringObject="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|MY_DB.mdb;Persist Security Info=True;Jet OLEDB:Database Password=pass" IsAppSettingsProperty="false" Modifier="Assembly" Name="MY_DB.mdb" Provider="System.Data.OleDb" />
I would like to replace |DataDirectory| with the result of a function called MyDBPath(), can anyone assist.
My code comes up with this error when i click save "Form exception was unhanded" , " Input string was not in a correct format."
[Code]...
Suppose i have two strings which is given below.
CODE:
Where ever i find , it should be replaced one blank line and " replace by "
When i migrated the data from MYSQL to SQL Server 2005, i found few problem in one of the column. In MYSQL indicates as new line and " indicates as ".
I have a problem with the code, I have input the valid username and password in the form textbox to input the strings in php, but it keep displaying the messagebox that says login failed.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show("Please enter your username")
ElseIf Textbox2.Text = Nothing Then
MessageBox.Show("Please enter your password")
Else
[CODE]...
I don't really know why it keep displaying the messagebox that says it failed when I have input the valid strings in the first place.
Problem: Your task is to take input from the user in string and give the following options to the user in a menu.
1- Find a String
2- Create sub-string
3- Erase a portion of a sting
4- Replace a word in the string
5- Count number of words and characters in the string without spaces.
6- Capitalize first character of each new sentence and convert the rest
of the characters to lower case.
7- Sort all the words in alphabetical order. (Use Bubble sort algorithm to perform sorting).
To perform all the above mentioned tasks you can only use pointers. Create a function to perform every task.
how to input a data/value to excel through vb input form and get the data/value from excel back to the input form?? (For example: put a number into exel A1 from input form and get another number from ecel B1 bact to the input form)
View 1 Repliesi am making a l337 speak generator..Lets say I input bob12321 (although i can input anything)I would like to make the program replace the "b" with either [code]How would i do that... I tried string.replace - but it says character A cannot be turned into long (on a seperate word)[code]
View 6 RepliesI have a non standard text file, ie its not delimted etc, its pretty much free flowing. What I want to do is to search for a specifc string eg. "xyz123" and then replace it with what a user types into a text box, lets call the text box and its contents "txtreplace".
I am trying to replicate a find and replace function essentially, but will need to tailor it later on down the line, but this will be a starting point.
I am using System.IO.FIle.ReadAllText() to get the contents of some template files that I created for email content. Then I want to do a Replace on certain tokens within the files so I can add dynamic content to the template.Here is the code I have, it seems to me like it should work just fine...
Dim confirmUrl As String = Request.ApplicationPath & "?v=" & reg.AuthKey
Dim text As String = IO.File.ReadAllText( _
ConfigurationManager.AppSettings("sign_up_confirm_email_text").Replace("~", _
[code].....
For some reason I cannot get the %%LINK%% and %%NAME%% Replace() calls to work properly. I checked to see if it was encoding-related, so I made each file UTF-8. And also used the forced encoding overload of ReadAllText(String, Encoding) and still no dice.
I designed a class contains a form that have buttons. When i click any button this function runs
Public Sub BtnClick(ByVal sender As Object, ByVal e As EventArgs)
result = CType(sender, Button).Text
[CODE]...
In another project I imported this class. I called the method that shows the form in my class. I need to store the 'result' variable in another variable in the new project. How can It be done.
I am working on a sub that essentially needs to open a text file, and replace all instances of a certain character with a unicode character. I'm trying to do this by reading the original text file byte by byte, converting it to a character, and then either adding that character to a memory stream or writing the unicode character to the memory stream. Then I'm saving the memory stream to the original file.
[Code]...
We know that VB string start and end with double quotes " "
So we have to use "" if we want " in VB string.
I wonder if there is a regular expression pattern which will match VB string?.
how can I replace all string in string variable like
dim str = "I am testing and testing and testing"
After replace with "and"
ReplaceAll(str,"and","or")
How can I replace all with case insentive not case sensative?
I.E. replace "http:adf.ly/random"to "adf DOT ly /random"..Removes http: and changes . to DOT and adds spaces.
View 3 RepliesI have a text box for user key in a formula,like '1+3-5',and i need to solve and display the answer.
Also need to handle the brackets,like '9+(2*4)'.
Operation is plus,minus,multiply,devide.
I am trying to create a dynamic string statement[code]...
View 7 RepliesI need to do is post my results from an IF statment to show up in a text box, but i am not sure [code]...
View 3 Repliesmy string is like this
tFunName= t11+t1* t2% t11
i want replace t1 to Text1
tFunName= tFunName.Replace(tControlName, PropertyValue)
But result is come like this -> Text11+ Text1* t2% Text11
But i dont want like this i want replace exact t1 Only and i want result like this t11 + Text1 + t2 + t11
I have the following value 48.81, it comes as a string from the database, I need to convert it to decimal, I'm using:
Dim Seconds As Decimal = Convert.ToDecimal((Coordinate.Substring(4, 5)), CultureInfo.InvariantCulture)
I'm receiving 4881D and I need 48,81
I thought CultureInfo.InvariantCulture was going to help me with that
EDIT:The coordinate value is 675900.244.I'm "spliting" it like this:
Dim Degress As Integer = Coordinate.Substring(0, 2),
Dim Minutes As Integer = Coordinate.Substring(2, 2),
Dim Seconds As Decimal = Convert.ToDecimal((Coordinate.Substring(4, 5)), CultureInfo.InvariantCulture),
[code]....
This is the value of the coordinate in the database?
How can i format a decimal result to a string without the .00 suffix?
View 7 RepliesIm trying to to detect what is in the string and so something for each different result but im not sure howto, here was my first idea but it obviously doesnt work as you cant use contains that way:
Select Case omg.Contains
Case "1"
MsgBox("1")
Case "2"
MsgBox("2")
End Select
I have a keyword search in my program that searches a SQL database table and displays all records that match that keyword in a datagridview. As some of the results can be quiet big i would like to highlight the word in the result that matches the keyword in RED. How can i do this?
Dim count As Integer
Dim word() As String
For count = 0 To DataGridView1.Rows.Count - 2
[code]....
I am reading a text file and I need to replace a few areas with new text that I marked with {0}, {1}, {2}, {3}, {4}, {5}, {6}. So I load in the text, save it to a string variable, and then use String.Replace but it's not working.
For i As Integer = 0 To 6
fileText.Replace("{" & i & "}", DisplayStudentData(i))
Next[code].....
I put all the data items into an array, then did this after loading the text file:
fileText = String.Format(fileText, dArr(0), dArr(1), dArr(2), dArr(3), dArr(4), dArr(5), dArr(6))
Is this a good way of doing it?
I have a string, lets say "((HRARNT*50)/100) + ((HRA*10)/100)"
And, i have value for HRA, HRARNT in a DGV and i want to replace it with its value to get "((5000*50)/100) + ((3500*10)/100)"
But, problem arises when it replace HRARNT with "3500RNT" as it got HRA value in DGV.
Now, i want it to first check if its prefixed or suffixed with +,-,*,/,),( then only it should replace with its subsequent value from DGV.
Though, first i tried placing HRA,HRARNT in [] and then replace, which worked fine, but users don't want to add [].
How to implement above logic?