473,811 Members | 2,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

String manipulation

Hi everyone!

I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.

Any help appreciated.

Thank you!
Jul 4 '08 #1
14 2541
On Fri, 4 Jul 2008 15:48:50 -0700 (PDT), Jamenson wrote:
Hi everyone!

I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.

Any help appreciated.

Thank you!
You'll have to create a User Defined Function using StrConv() and a
look-up table to find names with these different kinds of
capitalizations , i.e. McDonald, O'Brien, Smith-Jones, van den Steen,
etc.,
or .....
manually search and change these relatively few oddball
miss-capitalizations .

Be aware, also, that sometimes the same name can be capitalized
differently. McDaniels and Mcdaniels are both correct.

Of course the best method is correct data entry. <g>

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jul 4 '08 #2
On 4 jul, 20:01, fredg <fgutk...@examp le.invalidwrote :
On Fri, 4 Jul 2008 15:48:50 -0700 (PDT), Jamenson wrote:
Hi everyone!
I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.
Any help appreciated.
Thank you!

You'll have to create a User Defined Function using StrConv() and a
look-up table to find names with these different kinds of
capitalizations , i.e. McDonald, O'Brien, Smith-Jones, van den Steen,
etc.,
or .....
manually search and change these relatively few oddball
miss-capitalizations .

Be aware, also, that sometimes the same name can be capitalized
differently. McDaniels and Mcdaniels are both correct.

Of course the best method is correct data entry. <g>

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thank you Fred for your help, but, unfortunately, I am not a clever
boy in Microsoft Access. Even I am not a professional IT or
professional programmer, or such like that. I have designed a database
to supply the needs of a Small Office. When we started using the
database, I have noticed that people was typing customer names in an
innadequate way: capitalized. So, if you could, explicitly, show me
the code, it could be better for me understant and implement it.

Best regards.

Jamenson Ferreira Espindula
Recife - Pernambuco - Brazil.
Jul 5 '08 #3
Jamenson wrote:
On 4 jul, 20:01, fredg <fgutk...@examp le.invalidwrote :
>>On Fri, 4 Jul 2008 15:48:50 -0700 (PDT), Jamenson wrote:
>>>Hi everyone!
>>>I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.
>>>Any help appreciated.
>>>Thank you!

You'll have to create a User Defined Function using StrConv() and a
look-up table to find names with these different kinds of
capitalizatio ns, i.e. McDonald, O'Brien, Smith-Jones, van den Steen,
etc.,
or .....
manually search and change these relatively few oddball
miss-capitalizations .

Be aware, also, that sometimes the same name can be capitalized
differently . McDaniels and Mcdaniels are both correct.

Of course the best method is correct data entry. <g>

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


Thank you Fred for your help, but, unfortunately, I am not a clever
boy in Microsoft Access. Even I am not a professional IT or
professional programmer, or such like that. I have designed a database
to supply the needs of a Small Office. When we started using the
database, I have noticed that people was typing customer names in an
innadequate way: capitalized. So, if you could, explicitly, show me
the code, it could be better for me understant and implement it.

Best regards.

Jamenson Ferreira Espindula
Recife - Pernambuco - Brazil.
This is what I've done in the past. When a person enters data into a
name field, within a form, I will it compare to proper case. If the two
don't match, I convert it to proper case. After that, I leave it alone.
If a person "fixes" the proper case it was because he/she
wanted/needed to or is a bonehead.

I create a variable in the declarations section of a form's module
Dim blnName As Boolean

In the OnCurrent event I'll set the value of the variable. If the
namefield has a value, it's set to true
blnName = (IsNull(Me.Your NameField))

In the AfterUpdate event of NameField I have code similar to
If not blnName then
'it was an empty name field. 3 = vbProperCase
If Me.YourNameFiel d <StrConv(Me.You rNameField,3) then
Me.YourNameFiel d = StrConv(Me.Your NameField,3)
msgbox "The name field was propercased."
blnName = True
Endif
Endif

If the person get's the message, they can adjust without warning afterwards.

Lambada
http://www.youtube.com/watch?v=5AfTl5Vg73A

Jul 6 '08 #4
In article <ac7c3567-932a-4db2-90a4-708c75cd61e9@
79g2000hsk.goog legroups.com>, ja************* **@hotmail.com says...
On 4 jul, 20:01, fredg <fgutk...@examp le.invalidwrote :
On Fri, 4 Jul 2008 15:48:50 -0700 (PDT), Jamenson wrote:
Hi everyone!
I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.
Any help appreciated.
Thank you!
You'll have to create a User Defined Function using StrConv() and a
look-up table to find names with these different kinds of
capitalizations , i.e. McDonald, O'Brien, Smith-Jones, van den Steen,
etc.,
or .....
manually search and change these relatively few oddball
miss-capitalizations .

Be aware, also, that sometimes the same name can be capitalized
differently. McDaniels and Mcdaniels are both correct.

Of course the best method is correct data entry. <g>

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Thank you Fred for your help, but, unfortunately, I am not a clever
boy in Microsoft Access. Even I am not a professional IT or
professional programmer, or such like that. I have designed a database
to supply the needs of a Small Office. When we started using the
database, I have noticed that people was typing customer names in an
innadequate way: capitalized. So, if you could, explicitly, show me
the code, it could be better for me understant and implement it.

Best regards.

Jamenson Ferreira Espindula
Recife - Pernambuco - Brazil.
I think you will have a rough time converting this string, because you
are not separating the first name and the last name. There should be a
table column for first name and another column for last name. Often
there
are also columns for middle name, title and suffix.

Dr. | Jameson | Ferreira | Espindua | M.D.

Private Sub txt_last_name_A fterUpdate()
If Not IsNull(Me.txt_l ast_name) Then
Me.txt_last_nam e = ProperCase(Me.t xt_last_name)
End If
End Sub

Note that this function is not my code. You should be able to google for
the referenced message.

'===
Function ProperCase(ByVa l strName As String) As String

' Function mConvSN is from Michael Rochler,
' microsoft.publi p.access.formsc oding, 3 Jul 2000

Dim strOriginal As String
Dim intIsSame As Integer

strOriginal = strName ' save original name
strName = mConvSN(strName ) ' convert to proper case
ProperCase = strOriginal ' this if the default value

' next 2 lines for testing only
'intIsSame = StrComp(strName , strOriginal, 0)
'Debug.Print strName, strOriginal, intIsSame

If StrComp(strName , strOriginal, 0) Then
If MsgBox("Change " & strOriginal & " to " & strName & "?", _
vbYesNo + vbQuestion, "Entry changed!") = vbYes Then
ProperCase = strName
End If
End If
End Function

'-----------------------------------------------------------
Public Function mConvSN(ByVal varTxt As Variant) As Variant
'-----------------------------------------------------------
' this is part of ProperCase

On Error GoTo Err_mConvSN
Static astrPrefix(14) As String 'I changed this number
Dim strPatt As String
Dim iNdx As Integer
Dim iPos As Integer
Dim bOK As Integer

' initialize
mConvSN = vbNullString
varTxt = Trim(varTxt)
If mChkIsNothing(v arTxt) Then Exit Function

' initialize array
InitArray_mConv SN:
astrPrefix(0) = "D' "
astrPrefix(1) = "D'"
astrPrefix(2) = "Da "
astrPrefix(3) = "De La "
astrPrefix(4) = "De "
astrPrefix(5) = "Du "
astrPrefix(6) = "La "
astrPrefix(7) = "Le "
astrPrefix(8) = "Van Den "
astrPrefix(9) = "Van Der "
astrPrefix(10) = "Van "
astrPrefix(11) = "Von Den "
astrPrefix(12) = "Von Der "
astrPrefix(13) = "Von "
astrPrefix(14) = "Di "

GoSub Proper_mConvSN
GoSub Foreign_mConvSN
GoSub Scottish_mConvS N
GoSub Hyphenated_mCon vSN
GoSub Apostrophe_mCon vSN
mConvSN = varTxt

On Error GoTo 0
Exit Function 'mConvSN

'-------------------------------------------------

'Doc_mConvSN: 'Documentation; not actually called.
'PURPOSE:
'Convert surname to proper case, but also handle correctly standard
'surname prefixes such as "von der", "de la", etc. Calling routine
'should take measures to check whether spelling is unchanged, but
'capitalisation has changed, in which case user is not happy with
'suggested surname prefix and has overridden it (perhaps because it
'should be Anglicised).

'IN:
' varTxt - The surname to be automatically converted.
'OUT:
' - Function returns converted surname.

'EXAMPLES:
' mConvSN ("roCHLER") returns "Rochler"
' mConvSN (" roCHLER ") returns "Rochler"
' mConvSN("VON DER BORCH") returns "von der Borch"
' mConvSN("FOTHER INGTON-THOMAS") returns "Fotheringt on-Thomas"
' mConvSN ("MACDONALD" ) returns "Macdonald"
' mConvSN("MCINTY RE") returns "McIntyre"
' mConvSN ("o'conNOR") returns "O'Connor"
' mConvSN ("de LA forge") returns "de la Forge"
'Doc_mConvSN

'------------
Err_mConvSN:
MsgBox "Sorry, an error has occurred." & vbCrLf & _
"Error number: " & Err.Number & vbCrLf & "Error: " & _
Err.Description , vbCritical & vbOKOnly, "Error"
Resume Next
'Err_mConvSN

'------------------
Apostrophe_mCon vSN:
'Surnames like O'Connell.
If varTxt Like "*'*" Then
iPos = InStr(2, varTxt, "'", 1)
If iPos 0 Then varTxt = Left(varTxt, iPos) & _
UCase(Mid(varTx t, iPos + 1, 1)) & _
Right(varTxt, Len(varTxt) - iPos - 1)
End If
Return 'Apostrophe_mCo nvSN

'---------------
Foreign_mConvSN :
'Find and convert foreign prefixes to lower case.
For iNdx = 0 To 14
strPatt = astrPrefix(iNdx ) & "*"
If varTxt Like strPatt Then
varTxt = LCase(astrPrefi x(iNdx)) & _
Right(varTxt, Len(varTxt) - Len(astrPrefix( iNdx)))
Exit For
End If
Next iNdx
Return 'Foreign_mConvS N:

'-------------------
Hyphenated_mCon vSN:
'Hyphenated surnames like Bindon-Howell
' or Fotherington-Thomas.
If varTxt Like "*-*" Then
iPos = InStr(2, varTxt, "-", 1)
If iPos 0 Then varTxt = Left(varTxt, iPos) & _
UCase(Mid(varTx t, iPos + 1, 1)) & _
Right(varTxt, Len(varTxt) - iPos - 1)
End If
Return 'Hyphenated_mCo nvSN

'-----------------
Proper_mConvSN:
'Convert every word to a l/c word beginning with initial
'u/c character.
varTxt = StrConv(varTxt, vbProperCase)
Return 'Proper_mConvSN :

'-----------------
Scottish_mConvS N:
'Scottish: Leave Macdonald alone, but adjust Mc* names like McKay.
If varTxt Like "Mc*" Then varTxt = "Mc" & _
UCase(Mid(varTx t, 3, 1)) & Right(varTxt, Len(varTxt) - 3)
Return 'Scottish_mConv SN

End Function 'mConvSN

'---------------------------------------------------------
Function mChkIsNothing(B yVal varVal As Variant) As Integer
'---------------------------------------------------------
' this is part of properCase

On Error Resume Next

mChkIsNothing = False
Select Case VarType(varVal)
Case vbEmpty, vbNull
mChkIsNothing = True
Case vbString
If Len(varVal) = 0 Then mChkIsNothing = True
Case Else
End Select
End Function 'mChkIsNothing

Jul 7 '08 #5
Steve/Mark/Michael/<other aliases>, you're at it again. Buzz off. Stop
spamming. Others have indicated the task is non-trivial; you don't need to
scare the poster into hiring you. We're going to make sure that posters
know you post incorrect answers, and they aren't going to hire you -- even
at "reasonable rates", you are angling for a lifetime job on this one,
aren't you?

Dear Original Poster: Michael and Mark are aliases for Steve, a spamming
troll who posts here and tries to solicit business "at very reasonable
rates" but the solutions he posts here are often wrong, or incomplete
(perhaps so you will contact him and hire him to work out your problem), and
we'd recommend you avoid him like the plague.

Larry Linson
Microsoft Office Access MVP
Jul 7 '08 #6
On 6 jul, 21:43, Michael Gramelspacher <grame...@psci. netwrote:
In article <ac7c3567-932a-4db2-90a4-708c75cd61e9@
79g2000hsk.goog legroups.com>, jamensonespind. ..@hotmail.com says...


On 4 jul, 20:01, fredg <fgutk...@examp le.invalidwrote :
On Fri, 4 Jul 2008 15:48:50 -0700 (PDT), Jamenson wrote:
Hi everyone!
I want to convert strings like "LEONARDO DI CAPRIO" to "Leonardo di
Caprio". The function StrConv converts to "Leonardo Di Caprio" and we
think it is innapropriated.
Any help appreciated.
Thank you!
You'll have to create a User Defined Function using StrConv() and a
look-up table to find names with these different kinds of
capitalizations , i.e. McDonald, O'Brien, Smith-Jones, van den Steen,
etc.,
or .....
manually search and change these relatively few oddball
miss-capitalizations .
Be aware, also, that sometimes the same name can be capitalized
differently. McDaniels and Mcdaniels are both correct.
Of course the best method is correct data entry. <g>
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thank you Fred for your help, but, unfortunately, I am not a clever
boy in Microsoft Access. Even I am not a professional IT or
professional programmer, or such like that. I have designed a database
to supply the needs of a Small Office. When we started using the
database, I have noticed that people was typing customer names in an
innadequate way: capitalized. So, if you could, explicitly, show me
the code, it could be better for me understant and implement it.
Best regards.
Jamenson Ferreira Espindula
Recife - Pernambuco - Brazil.

I think you will have a rough time converting this string, because you
are not separating the first name and the last name. *There should be a
table column for first name and another column for last name. Often
there
are also columns for middle name, title and suffix.

Dr. *| *Jameson *| *Ferreira *| Espindua *| *M.D.

Private Sub txt_last_name_A fterUpdate()
* *If Not IsNull(Me.txt_l ast_name) Then
* * * Me.txt_last_nam e = ProperCase(Me.t xt_last_name)
* *End If
End Sub

Note that this function is not my code. You should be able to google for
the referenced message.

'===
Function ProperCase(ByVa l strName As String) As String

* *' Function mConvSN is from Michael Rochler,
* *' microsoft.publi p.access.formsc oding, 3 Jul 2000

* *Dim strOriginal As String
* *Dim intIsSame As Integer

* *strOriginal = strName * * * ' save original name
* *strName = mConvSN(strName ) *' convert to proper case
* *ProperCase = strOriginal * *' this if the default value

* *' next 2 lines for testing only
* *'intIsSame = StrComp(strName , strOriginal, 0)
* *'Debug.Print strName, strOriginal, intIsSame

* *If StrComp(strName , strOriginal, 0) Then
* * * If MsgBox("Change " & strOriginal & " to " & strName & "?", _
* * * * *vbYesNo + vbQuestion, "Entry changed!") = vbYes Then
* * * * *ProperCase = strName
* * * End If
* *End If
End Function

'-----------------------------------------------------------
Public Function mConvSN(ByVal varTxt As Variant) As Variant
'-----------------------------------------------------------
' this is part of ProperCase

* * On Error GoTo Err_mConvSN
* * Static astrPrefix(14) As String *'I changed this number
* * Dim strPatt As String
* * Dim iNdx As Integer
* * Dim iPos As Integer
* * Dim bOK As Integer

* * ' initialize
* * mConvSN = vbNullString
* * varTxt = Trim(varTxt)
* * If mChkIsNothing(v arTxt) Then Exit Function

* * ' initialize array
InitArray_mConv SN:
* * astrPrefix(0) = "D' "
* * astrPrefix(1) = "D'"
* * astrPrefix(2) = "Da "
* * astrPrefix(3) = "De La "
* * astrPrefix(4) = "De "
* * astrPrefix(5) = "Du "
* * astrPrefix(6) = "La "
* * astrPrefix(7) = "Le "
* * astrPrefix(8) = "Van Den "
* * astrPrefix(9) = "Van Der "
* * astrPrefix(10) = "Van "
* * astrPrefix(11) = "Von Den "
* * astrPrefix(12) = "Von Der "
* * astrPrefix(13) = "Von "
* * astrPrefix(14) = "Di "

* * GoSub Proper_mConvSN
* * GoSub Foreign_mConvSN
* * GoSub Scottish_mConvS N
* * GoSub Hyphenated_mCon vSN
* * GoSub Apostrophe_mCon vSN
* * mConvSN = varTxt

* * On Error GoTo 0
Exit Function 'mConvSN

'-------------------------------------------------

'Doc_mConvSN: 'Documentation; not actually called.
* * 'PURPOSE:
* * 'Convert surname to proper case, but also handle correctly standard
* * 'surname prefixes such as "von der", "de la", etc. Calling routine
* * 'should take measures to check whether spelling is unchanged, but
* * 'capitalisation has changed, in which case user is not happy with
* * 'suggested surname prefix and has overridden it (perhaps because it
* * 'should be Anglicised).

* * 'IN:
* * ' * varTxt - The surname to be automatically converted.
* * 'OUT:
* * ' * * * * *- Function returns converted surname.

* * 'EXAMPLES:
* * ' * mConvSN ("roCHLER") returns "Rochler"
* * ' * mConvSN (" * roCHLER *") returns "Rochler"
* * ' * mConvSN("VON DER BORCH") returns "von der Borch"
* * ' * mConvSN("FOTHER INGTON-THOMAS") returns "Fotheringt on-Thomas"
* * ' * mConvSN ("MACDONALD" ) returns "Macdonald"
* * ' * mConvSN("MCINTY RE") returns "McIntyre"
* * ' * mConvSN ("o'conNOR") returns "O'Connor"
* * ' * mConvSN ("de LA forge") returns "de la Forge"
'Doc_mConvSN

'------------
Err_mConvSN:
* * MsgBox "Sorry, an error has occurred." & vbCrLf & _
* * "Error number: " & Err.Number & vbCrLf & "Error: " & _
* * Err.Description , vbCritical & vbOKOnly, "Error"
* * Resume Next
'Err_mConvSN

'------------------
Apostrophe_mCon vSN:
* * 'Surnames like O'Connell.
* * If varTxt Like "*'*" Then
* * * * iPos = InStr(2, varTxt, "'", 1)
* * * * If iPos 0 Then varTxt = Left(varTxt, iPos) & _
* * * * UCase(Mid(varTx t, iPos + 1, 1)) & _
* * * * Right(varTxt, Len(varTxt) - iPos - 1)
* * End If
Return 'Apostrophe_mCo nvSN

'---------------
Foreign_mConvSN :
* * 'Find and convert foreign prefixes to lower case.
* * For iNdx = 0 To 14 * * * *
* * * * strPatt = astrPrefix(iNdx ) & "*"
* * * * If varTxt Like strPatt Then
* * * * * * varTxt = LCase(astrPrefi x(iNdx)) & _
* * * * * * Right(varTxt, Len(varTxt) - Len(astrPrefix( iNdx)))
* * * * * * Exit For
* * * * End If
* * Next iNdx
Return 'Foreign_mConvS N:

'-------------------
Hyphenated_mCon vSN:
* * 'Hyphenated surnames like Bindon-Howell
* * ' or Fotherington-Thomas.
* * If varTxt Like "*-*" Then
* * * * iPos = InStr(2, varTxt, "-", 1)
* * * * If iPos 0 Then varTxt = Left(varTxt, iPos) & _
* * * * UCase(Mid(varTx t, iPos + 1, 1)) & _
* * * * Right(varTxt, Len(varTxt) - iPos - 1)
* * End If
Return 'Hyphenated_mCo nvSN

'-----------------
Proper_mConvSN:
* * 'Convert every word to a l/c word beginning with initial
* * 'u/c character.
* * varTxt = StrConv(varTxt, vbProperCase)
Return 'Proper_mConvSN :

'-----------------
Scottish_mConvS N:
* * 'Scottish: Leave Macdonald alone, but adjust Mc* names like McKay..
* * If varTxt Like "Mc*" Then varTxt = "Mc" & _
* * UCase(Mid(varTx t, 3, 1)) & Right(varTxt, Len(varTxt) - 3)
Return 'Scottish_mConv SN

End Function 'mConvSN

'---------------------------------------------------------
Function mChkIsNothing(B yVal varVal As Variant) As Integer
'---------------------------------------------------------
' this is part of properCase

* * On Error Resume Next

* * mChkIsNothing = False
* * Select Case VarType(varVal)
* * * * Case vbEmpty, vbNull
* * * * * * mChkIsNothing = True
* * * * Case vbString
* * * * * * If Len(varVal) = 0 Then mChkIsNothing = True
* * * * Case Else
* * End Select
End Function 'mChkIsNothing- Ocultar texto entre aspas -

- Mostrar texto entre aspas -
Great work boys! Thank you!

I will to analize and implement the solutions appointed here. After
tests, I will come back and tell you the result.

Thank you very much!
Jul 7 '08 #7
In article <Cnuck.1085$bn3 .44@trnddc07>, bo*****@localho st.not says...
Steve/Mark/Michael/<other aliases>, you're at it again. Buzz off. Stop
spamming. Others have indicated the task is non-trivial; you don't need to
scare the poster into hiring you. We're going to make sure that posters
know you post incorrect answers, and they aren't going to hire you -- even
at "reasonable rates", you are angling for a lifetime job on this one,
aren't you?

Dear Original Poster: Michael and Mark are aliases for Steve, a spamming
troll who posts here and tries to solicit business "at very reasonable
rates" but the solutions he posts here are often wrong, or incomplete
(perhaps so you will contact him and hire him to work out your problem), and
we'd recommend you avoid him like the plague.

Larry Linson
Microsoft Office Access MVP
Larry, I am exactly who I say I am.
http://www.psci.net/gramelsp/gramelsp/

You owe me an apology.

Mike Gramelspacher, Jr.
Jul 7 '08 #8
It seems that Larry Linson, or someone inmpersonating him, believes that
I am an alias for Steve or Mark. However, I am exactly who I am. This
is my web page:

http://www.psci.net/gramelsp/gramelsp/Index.htm

My web address and email address have not changed since about 1996. It
seems like it would be a simple thing to discover who I am. There are
four Michael Gramelspachers in the United States that I am aware of; we
are only distantly related.

I am not a programmer. I am not a developer. My work in real life does
not involve computers. Access is a hobby.

Mike Gramelspacher, Jr.
Jul 8 '08 #9
I have studied and tested the solution shown by "Salad" (6, jul), but
unfortunatly it does not work like the post demand. I figure out that
it does as exactly the same as StrConv, so a name like "Jesus of
Nazareth" is converted to "Jesus Of Nazareth" and that shows
inapropriate. Am I making myself clear enough or not?

Thank you

Jamenson Ferreira Espindula.
Jul 13 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2279
by: Dim | last post by:
I found that C# has some buggy ways to process string across methods. I have a class with on global string var and a method where i add / remove from this string Consider it a buffer... with some values and separators class { private string globalvar = ""; private void manipulate (whattodo ) //substring, join, etc....
32
14918
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
29
4329
by: zoro | last post by:
Hi, I am new to C#, coming from Delphi. In Delphi, I am using a 3rd party string handling library that includes some very useful string functions, in particular I'm interested in BEFORE (return substring before a pattern), AFTER (return substring after a pattern), and BETWEEN (return substring between 2 patterns). My questions are: 1. Can any tell me how I can implement such functionality in C#? 2. Is it possible to add/include function...
4
3497
by: WaterWalk | last post by:
Hello, I'm currently learning string manipulation. I'm curious about what is the favored way for string manipulation in C, expecially when strings contain non-ASCII characters. For example, if substrings need be replaced, or one character needs be changed, what shall I do? Is it better to convert strings to UCS-32 before manipulation? But on Windows, wchar_t is 16 bits which isn't enough for characters which can't be simply encoded...
10
1778
by: micklee74 | last post by:
hi if i have a some lines like this a ) "here is first string" b ) "here is string2" c ) "here is string3" When i specify i only want to print the lines that contains "string" ie the first line and not the others. If i use re module, how to compile the expression to do this? I tried the re module and using simple
5
7497
by: Niyazi | last post by:
Hi, Does anyone knows any good code for string manipulation similar to RegularExpresion? I might get a value as string in a different format. Example: 20/02/2006 or 20,02,2006 or 20.02.2006 etc... And I want to replace the /,.etc character with - (as 20-02-2006)
3
1566
by: crprajan | last post by:
String Manipulation: Given a string like “This is a string”, I want to remove all single characters( alphabets and numerals) like (a, b, 1, 2, .. ) . So the output of the string will be “This is string” This is very urgent. Please help
7
2108
Frinavale
by: Frinavale | last post by:
I currently have a .NET application that has an object which passes a string (a connection string) as a parameter to another object that does database manipulation. This string isn't stored anywhere else and is only used by this behind-the-scenes object to provide the database manipulation object with a connection string. Does my connection string pose a security problem when it is inside the code like this? Or are connection strings...
3
3567
by: frankeljw | last post by:
I have 2 Java strings 1st String is a series of names, colons, and numbers ie) Name1:13:Name2:4526:Name3:789:Name4:3729:Name5:6:Name6:44 2nd String is a name ie) Name2 I need to get the number associated with that name.
22
2628
by: mann_mathann | last post by:
can anyone tell me a solution: i cannot use the features in standard c++ string classgh i included the string.h file but still its not working.
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10395
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10408
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5561
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4346
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3874
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3026
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.