C# - Built-in Function To Repeat String Or Char In .net?
Nov 6, 2010Best way to repeat a character in C#
I wonder if there is a function that returns x times of given char or string. Or I must code it?
Best way to repeat a character in C#
I wonder if there is a function that returns x times of given char or string. Or I must code it?
Function to test first char of string
View 9 RepliesAfter checking an Xps file i noticed that the string within the Xps file <> is converted to <>So is there any built-in function in the .Net framework that could do this job for me?If it does not exist what characters becides <> should i escape in myOwn function?
I try to implement a search within an xps file, but searching for <> instead of <> returns nothing.
UPDATE: At least i found the list here of xml document escape characters
i want to generate a serial key which depend on system harddisk manufacture id ...
so Is any function which take string of alfanumeric + special char as input and after encrypted return output as unique serial key / product key...
how to remove or replace specific characters from a string. The code sample is provided contains a VBScript function to parse a string, replacing or removing any character found in the array declared at the beginning of the function.VBScript String Clean Function - Remove/Replace Illegal CharatersThe function was originally writted to remove illegal characters found in a string for use as a document file name in SharePoint Document Library.To use the function, simply update the array at the beginnning of the function to include all of the characters which are to be removed or replaced. If replacing specific characters with something else, the you will need to set inside the finction the string which will replace each character if found.The VBScript function then returns a cleaned string.VBScript String Clean Function - Remove/Replace Illegal CharatersBlogs: SharePoint Development | Web Development & Programming | Webmaster resources & free SEO
View 1 Repliesi want to read a character 1 by 1 from a string and a .txt, i know all about stream reader so for the .txt would it be somthing like:textbox1.text = tr.readCharacter.i would prefer to be able to read from a textbox or String array though.
View 10 RepliesI need validation for string to comply with next: no space char starts with one delimiter char ends with one delimiter char has no other char as delimiter char. Updated sorry missed that should only be one delimiter char at start and at the end
View 2 RepliesUsing VB.Net
I am having the form name as "Employee Entry"
User want to open a Employee Entry from in 5 tabs...
For Example
When the user open a Employee Entry form, while entering the details at that same time, user again open a employee entry form (2nd Employee entry form show like a new employee entry from with out any details)[code]....
I need a textbox where you can add a number and if you press a button that it will repeat the function of the button the number of times as in the textbox.
View 9 RepliesI'm trying to make a mastermind game program with visual basic. I started of creating the combination maker for the start of the game. Hoever, in my version i don't want any colors to repeat. I used the random function independently to get numbers from 1 to 6. Each number has a corresponding color. The problem, the values still repeat sometimes.
Here's my code for that part:
Randomize
a = Fix(Rnd * 6) + 1
txtA = a
If a = 1 Then
[CODE]...
Someone once told me VB.net had some built-in function to check if two rectangles intersected. But I cannot find it.
View 1 Replieshave string "super" May i know is there a function in vb where i can repeat the string like using the below code and return "supersupersuper"
View 2 RepliesI want to convert a decimal value or a hexadecimal char.Someone could write a function?
View 5 RepliesHere is my string: (not real just made up) Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load WebBrowser1.Hide() End Sub Now if I want to repeat that string the ammount of times I say in TextBox1, how do I code that with that string code above?
View 4 RepliesI am trying to the copy the value from string to char array using String.CopyTo() method.
Here's my code
Dim strString As String = "Hello World!"
Dim strCopy(12) As Char
strString.CopyTo(0, strCopy, 0, 12)
[code]....
Edit : I get the this error at runtime.ArgumentOutOfRangeException Index and count must refer to a location within the string. Parameter name: sourceIndex
How do I (programmatically) find out the key repeat delay and key repeat rate for a system?
A solution that works on any/all .Net capable platforms would be ideal, but the key target OSes would be XP, Vista, and 7.
Is it possble in VB.Net to accress a control or object using a built up string?[code]...
View 2 RepliesI was wondrening if there is any built in functions to search for a sequence in a string
View 1 RepliesI used a built in function to create comma separated string using List easily.(It is not split and join but new function) I'm not able to recollect or find it. If some one knows about it and uses it please post a link to that. Framework - .net 2.0
(It is not Join or split - I know about this, .net has new built in function to create CSV format)
Check Jacob G Answer below for what i was looking for let me know your thoughts on it compared to join ;)
And whoever gave me -ve rep need to keep some patience and not hurry
I have a DLL that I am importing:Declare Function QueryInfo Lib "mydllname" (ByVal DevName As String, ByVal pcQueryParam As String, ByVal Result As String, ByVal Length As Int32) As Int32
[Code]...
Anyone have an idea what the issue could be? If I run similar code in VB6 (only diff is mtStatus = String(mtValueSize, Chr$(0)) ) it returns what I expect.
I create a small program witch is a tcp client.I sent a asqii string to a tcp device over ethernet thads acts like a server.As soon as the device recieves the input string it will respond back with response data. The problem is i am not getting any response data back from the divice. The lenght of the string is max. 30 characters.When a use WireShark i see the reponse, but VB read nothing.I have read many threads with explenations about server/client connections but no example of a client with a tcp listener built in.I think thad the stream read is to late after the send instruction.
View 2 RepliesI have built a DataTable from my database. Then I am looping through the rows and trying to access a string, however the value is being returned as each character in the string.
For Each theseRows In DisplayForm.MainTab.Rows
If theseRows.Item("Last_Name") = userLast And theseRows.Item("First_Name") = userFirst Then
[Code]....
The Trap_Code values are two or three letter strings, the returned value is each letter once at a time. The loop seems to cycle through the individual characters of the string as an array rather than display the entire value, which is what I was hoping for.
The following code:
If checkboxList.Items(i).Selected Then
.Fields("DESC1").Value += checkboxList.Items(i).Text + ", "
End If
should produce output such as "A, B, C,(space)", which will then be bound to a dynamically created GridView. I would like to remove the last two-char string, that is ",(space)". How can I do this?
I am writing a database and need to post a value in a lable to a sql field.the sql datatype is set to money.when posting i have
CMD.Parameters.addwithValue("@Claim", LBCLAIM.text)
when posting i gett an error
cannot convert a char vaule to money. the char vaule has incorrect syntax.
how can I cut the 1st 3 char in a string in vb 2008?
For example:
Dim i As String = "ABCDEF";
I want to only cut the 1st 3 char and the system will only display "ABC" after the 'cut' action done.
I want to convert say Input: textbox1.text=blabla Output: blabla becomes into: textbox2.text=(char45 & char34 char45 & char34 char45 & char64 )
[code]...
Im wanting to create a function that receives a string and moves the first letter to the end and returns it.
Public Function moveLetters(ByRef word As String) As String
Dim length As Integer = word.Length
Dim chars(length) As Char
[code]....
what is the best way to remove FileFinder1 from this string:
"C:Program FilesFileFinder1"
Basically the first letter of a string must be a certain letter. At the moment the only way I know how to do it is as follows:
If sConsignmentNo(0) = "J" Or sConsignmentNo(0) = "C" Or sConsignmentNo(0) = "U" Or sConsignmentNo(0) = "N" Or sConsignmentNo(0) = "H" Or sConsignmentNo(0) = "S" Or sConsignmentNo(0) = "V" Then
Basically listening the same thing out over and over. Is there a way I can say, If sConsignmentNo(0) = ListOfValidEntries i.e J,C,U,N etc?
Using Visual Basic 2008 and cant use regex!
Is it possible to immediately use code that is built in a dynamically built assembly?I would like to create an instance of an ENUM built using.http:[url]......
View 4 Replies