| | |
using "like" in C#
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 3
Reputation:
Solved Threads: 0
msspitul Member since: 5/21/2008 From: Northborough, MA, United States
Posted - 5/21/2008 12:43:01 PM
Hi,
I have a program that was originally in VB that I am trying to convert to C#. I have converted all of it succesfully accept for a part that uses the "like" statement.
The program starts off by having the user enter a file name that they want to work with, then clicking a button so that the file is uploaded and stored in an array. The user can then type in a peice of information into a textbox, click a button, and have the app display a peice of information from the datafile based on what they typed in.
The piece that I am trying to convert looks like this:
For x = 0 To n - 1
With order(x)
If .buyername Like TextBox3.Text & "*" Then
Label5.Text = .title
End If
If .sellername Like TextBox3.Text & "*" Then
Label5.Text = .title
End If
End With
Next
I've looked into many comparisons between VB and C# to see how a process like this could be accomplished in C# and havent found anything. Any suggestions would be greatly appreciated.
Posted - 5/21/2008 12:43:01 PM
Hi,
I have a program that was originally in VB that I am trying to convert to C#. I have converted all of it succesfully accept for a part that uses the "like" statement.
The program starts off by having the user enter a file name that they want to work with, then clicking a button so that the file is uploaded and stored in an array. The user can then type in a peice of information into a textbox, click a button, and have the app display a peice of information from the datafile based on what they typed in.
The piece that I am trying to convert looks like this:
For x = 0 To n - 1
With order(x)
If .buyername Like TextBox3.Text & "*" Then
Label5.Text = .title
End If
If .sellername Like TextBox3.Text & "*" Then
Label5.Text = .title
End If
End With
Next
I've looked into many comparisons between VB and C# to see how a process like this could be accomplished in C# and havent found anything. Any suggestions would be greatly appreciated.
Hi there msspitful and welcome to DaniWeb. I had to search on google for this, but I found your answer here:
http://bytes.com/forum/thread242168.html
I hope this helps! Please mark your thread as solved once you get the answer.
http://bytes.com/forum/thread242168.html
I hope this helps! Please mark your thread as solved once you get the answer.
If you have a quality, be proud of it and let it define you. Add it to the world!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
If you got your answer, please mark the thread as Solved. It saves time when people are looking to contribute threads or for answers!
•
•
Join Date: Jun 2008
Posts: 3
Reputation:
Solved Threads: 1
Yes, definitely IndexOf, LastIndexOf, StartsWith and EndsWith. I have a couple articles I wrote about these
http://dotnetperls.com/Content/IndexOf-IndexOfAny.aspx
http://dotnetperls.com/Content/StartsWith-EndsWith.aspx
Of course I don't do VB.NET. Hope this helps a tiny bit
Sam
http://dotnetperls.com/Content/IndexOf-IndexOfAny.aspx
http://dotnetperls.com/Content/StartsWith-EndsWith.aspx
Of course I don't do VB.NET. Hope this helps a tiny bit
Sam
![]() |
Similar Threads
- google "keyword" question (Search Engine Optimization)
- hotmail not showing "from" in inbox (Web Browsers)
- OS 9.2 freez on new mem alloc ("new" opperator) (OS 7 / 8 / 9)
- dynamic memory alloc with "new" freezes OS9.2 (C++)
Other Threads in the C# Forum
- Previous Thread: Making a Single Instance Application Reappear
- Next Thread: Problem with Crystal Report in C# VS2005
| Thread Tools | Search this Thread |
.net access algorithm alignment array barchart bitmap box broadcast buttons c# c#gridviewcolumn check checkbox client combobox communication control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing elevated encryption enum event excel file focus forloop form format forms function gdi+ hospitalmanagementsystem httpwebrequest image index input install java label list listbox localization login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting pointer post programming radians read regex remote remoting richtextbox server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml






