|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Needs help in stringHi: Can any one please tell me how to i change 00032 value in the
string without disturbing the original size of the string? the second curly bracket upto the starting character "O"is always same in the string 20070302 HD000000000{000000000{00032ODSS HCS1 newvalue=65 so it will be 20070302 HD000000000{000000000{00065ODSS HCS1 Thanks. See the Mid *statement*. The Mid function
gets a string within a string, but if you turn it around you replace a string within a string: Mid(s, 26, 2) = "65" Show quoteHide quote > Hi: Can any one please tell me how to i change 00032 value in the > string without disturbing the original size of the string? > > the second curly bracket upto the starting character "O"is always same > in the string > > 20070302 > HD000000000{000000000{00032ODSS HCS1 > > newvalue=65 > so it will be > 20070302 > HD000000000{000000000{00065ODSS HCS1 > > Thanks. >
Show quote
Hide quote
On 2 Mar 2007 11:26:16 -0800, "Anna" <colleen1***@gmail.com> wrote: Something like this?>Hi: Can any one please tell me how to i change 00032 value in the >string without disturbing the original size of the string? > >the second curly bracket upto the starting character "O"is always same >in the string > >20070302 >HD000000000{000000000{00032ODSS HCS1 > >newvalue=65 >so it will be >20070302 >HD000000000{000000000{00065ODSS HCS1 > >Thanks. Dim s As String s = "HD000000000{000000000{00032ODSS" Mid$(s, 26, 2) = "65" Debug.Print s
Show quote
Hide quote
"Rob" <r**@notvalid.com> skrev i meddelandet Or Mid$(s, 23, 5) = Right$("00000" & Format(newvalue),5)news:200hu219fptq2dl1319d7of41i65183fjg@4ax.com... > On 2 Mar 2007 11:26:16 -0800, "Anna" <colleen1***@gmail.com> wrote: > > >Hi: Can any one please tell me how to i change 00032 value in the > >string without disturbing the original size of the string? > > > >the second curly bracket upto the starting character "O"is always same > >in the string > > > >20070302 > >HD000000000{000000000{00032ODSS HCS1 > > > >newvalue=65 > >so it will be > >20070302 > >HD000000000{000000000{00065ODSS HCS1 > > > >Thanks. > > Something like this? > > Dim s As String > > s = "HD000000000{000000000{00032ODSS" > > Mid$(s, 26, 2) = "65" > > Debug.Print s > /Henning > Hi: Can any one please tell me how to i change 00032 value in the It is hard to know from your post if the "20070302" is part of the text > string without disturbing the original size of the string? > > the second curly bracket upto the starting character "O"is always same > in the string > > 20070302 > HD000000000{000000000{00032ODSS HCS1 > > newvalue=65 > so it will be > 20070302 > HD000000000{000000000{00065ODSS HCS1 string or not, so I assumed it was. Also, it is hard to know from your post if the location of the You can use this code as a model.... TheString = "20070302" & vbCrLf & _ "HD000000000{000000000{00065ODSS" & _ " HCS1" Mid$(TheString, InStr(TheString, "{00065") + 4) = "32" Rick
InStr anomaly?
using Line Input Stop loading data process Application crashing - trying to track down the problem. Convert decimal to fraction string Seriously OT: Vista Looking for an easy way to achive this problem. email attachments? Vb6 to check if a text file is already opened Server my program is trying to connect to is not a trusted site with XP? |
|||||||||||||||||||||||