Get Certain Chars In String?

Apr 4, 2011

I am making an antivirus program and i am having a problem with my database. how can i only get the hash in this string:

693248:ff807bd383d377f7f8f91ed4aa7677ae:Trojan.Agent-178374

i only want between the two ":"s in this string. how is this possible? and also how do i get the last part on the right of the last ":"?

View 3 Replies


ADVERTISEMENT

.net - Regex Replacing Non-words Chars In Strings, Ignoring Specific Chars?

Oct 8, 2011

In VB.net I've got the following line that removes all non-alphanumeric chars from a string:

return Regex.Replace(build, "[W]", "")

I now need to extend this to remove non-alphanumeric chars that aren't [] or _. I've changed the line to:

return Regex.Replace(build, "[W[]_]", "")

However I'm pretty sure that this says

replace non-word or [ or ] or _

how do I negate the tests for the [] and _ chars so that it says

replace non-word and not [ and not ] and not _

Some examples:

"[Foo Bar_123456]" => "[FooBar_123456]"
"[Foo Bar_123-456*]" => "[FooBar_123456]"

View 2 Replies

.net - Cast A List Object Of Chars In An Array Of Chars?

Nov 20, 2010

How to convert or make a cast of a List object typized as a container of chars like

Dim mylist As List(Of Char) = New List(Of Char)(New Char() {"1"c, "2"c})

in a simple array of chars as

Dim mychars() As Char

without make a loop for...

View 1 Replies

Remove Chars From String End?

Oct 29, 2009

I'm data binding to a label in a grid and need to knock off the last two chars, not so easy as I thought.I know this is wrong it just shows how I'm coding:

Code:Private Sub TemplateControl_DataBinding_Label(ByVal sender As Object, ByVal e As System.EventArgs)

[code].....

View 4 Replies

Lose Last 3 Chars From String Variable

Mar 25, 2010

if the last 4 chars in my string(result) are " AND" or the last three chars are " OR" I would like to remove these from the string. So far I have am trying result.trimend and a few other methods but am unsure how to get it working.

View 3 Replies

Removing Text Between Chars From A String

Apr 14, 2010

this is driving me crazy , I have a string like this dim s as string = "<a href="url.aspx? target=_BLANK>mik, H</a>" I want to remove "mik, h" from the string, how can i do that?

View 4 Replies

Using TrimEnd To Remove Certain Chars From The End Of A String

Apr 18, 2011

I am using TrimEnd to remove certain chars from the end of a string. Initially I thought this would work:

[Code]...

View 2 Replies

VS 2010 Reading Chars From A String?

Nov 11, 2011

still pretty new to programming in general, but I have most of the basics figured out.I stumbled across this problem today, though. I wanted to try making a simple encoder/decoder. However, I am having trouble getting characters from a string.

I have a list(of char) to separate the individual letters in the message (letterList), and textToConvert is the text that the user types in to be encoded. Here's the section of code my problem exists in:

For i = 0 To textToConvert.Length - 1
letterList(i) = textToConvert.Chars(i)
Next i

Upon running my program, I get an out of range exception for the middle line above. Am I doing something wrong?

View 3 Replies

.net - Remove Control Chars From UTF8 String?

Dec 21, 2010

i have a VB.NET program that handles the content of documents. The programm handles high volumes of documents as "batch"(>2Million documents;total 1TB volume) Some of this documents may contain control chars or chars like f0e8 [URL]). Is there a easy and especially fast way to remove that chars?(except space,newline,tab,...) If the answer is regex: Has anyone a complete regex for me?

View 2 Replies

Count Special Chars. From Text Box Or String?

Nov 11, 2009

tell me how to Count Special Characters from input STRING.

View 2 Replies

DataBinding To Label - Knock Chars Off String

Oct 29, 2009

Using VB.NET 2003 Asp.Net 1.1. I'm data binding to a label in a grid and need to knock off the last two chars, not so easy as I thought.

I know this is wrong it just shows how I'm coding:
Code:
<div id=CODE>Private Sub TemplateControl_DataBinding_Label(ByVal sender
As Object, ByVal e
As System.EventArgs)
Dim lc As Label
Dim sColumnName As
String = ""
[Code] .....

One problem is what I want to achieve:
I want to have:
$123.00
$15.00
$1,000.00
$123.50
$45.78

My data comes back with 4 places on the end
123.0000
15.0000
45.7800
35.9000

The $ sign I have in my code does work
so I have"
$123.0000
$15.5000
and so on.

I don't believe there will ever be a point where the last two are anything other than zeros.

View 3 Replies

Convert A Long String (Lets Say 550 Chars) Into Something Lower?

Mar 3, 2011

I'm trying to make a hash calculator (For testing now)

I know that MD5 is a 1 way(Meaning that there is no decryption for it, yet)

now I was wondering if SHA-1 is a two way. Also, is there any other hashing method that are 2way?

reason is that I want to convert a long string (Lets say 550 chars) into something lower (From 550chars to something lower then 550chars)

I can use a Key, but every possibility will give me bigger length then the actual string.

View 6 Replies

C# - Check If A String Contains An Alphanum Chars Appears At Least N Times Consecutively?

Dec 16, 2009

I am testing for a string if it contains at least n chars in consecutive order: I have this regex but it doesn't seems to work (w1){3,}

View 2 Replies

Regular Expression Replaces Special Chars With Numbers Instead Of String?

Jun 30, 2010

I'm using the following to strip special characters out of a URL:

Dim urlReg As New Regex("[^dw ]")
inurl = urlReg.Replace(inurl, "")

[code]......

View 2 Replies

Use Regex To Replace Non-word Chars In A Specific Piece Of String?

May 5, 2009

I have text file with a row like this:

[Code]...

View 2 Replies

.net - How To Allow Only A-Za-z Chars

Jun 10, 2012

I tried below code:

Private Sub txtName_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtName.KeyPress
' allow upper and lower case A-Z, and backspace

[Code]....

But it gives:

'KeyAscii' is not declared. It may be inaccessible due to its protection level.

how to allow alphabet only ?

View 4 Replies

Keyboard Chars

May 16, 2009

ok here is the situation. i have a form that is hidden. the form needs to wait until somone hits the F2 button.

View 1 Replies

.net SqlBulkCopy With Unicode Chars

Nov 29, 2010

i have a csv file that needs to be imported to sql server the file includes Unicode characters, so i saved it in notepad as Unicode now when i run this in sql it works excellent BULK INSERT personimps FROM 'C:MyImp.csv' WITH (FIELDTERMINATOR = ',',datafiletype='widechar')but when using the following in my code-behind in asp.net, i get gibberish where the Unicode chars should be. [code] it seems like the oledbconnection is ignoring the extended properties, or maybe i didn't set up the connection-string correctly? the ASCII chars come out OK, the Unicode fields are just gibberish.

View 1 Replies

Property 'Chars' Is 'ReadOnly'?

Jul 10, 2009

THis is a line of code i have, it's a code to go at the bottom of a document and the title of the question is the error it has, how do i change the 'Chars' to not be read only? I can only guess 'Chars' is a character.

pagecode(1) ="01274-6759q-DDD"

If you're not living on the edge, you're taking up too much room

View 1 Replies

ReadProcessMemory Returning Only 4 Chars?

Apr 12, 2009

let me show you my code first and then explain my problem.

[Code]...

View 2 Replies

Replace The Enter Key With An Other Set Of Chars?

May 11, 2009

How can i replace the enter key with an other set of chars

example - text.replace(" ", "this is a space")

that previous statement will replace all spaces with the string "this is a space"

how do i do this for an enter?

View 1 Replies

WebBrowser - Allow Chars In Textbox

Mar 11, 2010

Well I made another thread but I know how to make textbox allowed chars but is possible with web browsers? Like if f1 - f12 is pressed then nothing happen like nothing have been touch.

View 1 Replies

Work With Hex Bytes And Chars Like In C++?

Oct 11, 2010

Well my question is simple and straightforward. Is there any way we can use hex values like in c++?

I am going to write binary files, but for that i will have to define certain characters like this for example.

x00x00x11x22x33x00x00. I would first need to convert stuff like this to a byte array, and then write it to a binary text file.

View 2 Replies

C# - How To Write Unicode Chars To Console

Apr 21, 2011

I was wondering if it was possible, in a console application, to write characters like "℃" using .NET? When I try to write this character, the console outputs a question mark.

View 2 Replies

C# :: Let Only Some Chars Be Typed In A Datagridview Cell?

Apr 16, 2011

Is there a way to let only certain chars be added to a datagridview cell? like '1234567890'?

View 1 Replies

Create Strings From 2d Array Of Chars

Feb 22, 2011

I have a 2d array of chars and i need to start at (0,0) and creat a string and check it against some value then still then add another char to the first one and check it. I need to do that in every direction.[code]say im at the H their are like 8 way i need to check..

View 1 Replies

Enter A Certain Number Of Chars Into A Textbox?

Nov 30, 2010

It seems like I'm only able to enter a certain number of chars into a textbox.Like if I have a list from 1 to 10000.When I paste it in a textbox it ends like this:

5639
5640
5641

[code]....

Why cant I add everything to the textbox?

View 9 Replies

Get The Error Property 'Chars' Is 'ReadOnly'

Dec 17, 2011

I get the Error Property 'Chars' is 'ReadOnly'

View 3 Replies

Masked Text Box - Get Rid Of Extra Chars

Jul 7, 2010

I am using a masked text box to format phone numbers. However, I do not want the extra formatting that gets insterted from the masked text box: (800)-555-1212

All I want is: 8005551212

But I still want the user to type it in like this (to make it easier for user):
(800)-555-1212

I am thinking I can run a replace function on it, but I am not sure what event to use. I found a number of tutorials, but not that useful for what I am doing. [URL]

View 1 Replies

Parameterized Query And Special Chars

Nov 8, 2010

I solved this issue in this thread but there still are issues with special chars. ie 'I thought by doing parameters that it would take care of any special chars for you. Well i am still getting mysql exceptions about syntax. I look at the string it is working with and it has a "'" in it.Why are they not working as I expect them to?

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved