Replace some chars inside a String

2012-02-01  Source: Original Site  Category:Visual Basic  Views:0 


all..there is a Replace function for VB.. but I can't seem to get it to work..can it be used for strings?

suppose I have a string :

01 02 03 04

and then I wanna replace 02 with 00,

so, I use Instr function to first locate this 02, and then I wanna replace it..

I tried using Replace function but, it can't seem to work...

can anyone help me out?

Related articles
  • Replace some chars inside a String 2012-02-01

    all..there is a Replace function for VB.. but I can't seem to get it to work..can it be used for strings? suppose I have a string : 01 02 03 04 and then I wanna replace 02 with 00, so, I use Instr function to first locate this 02, and then I wanna re

  • replace a char in a string 2013-05-09

    What function could I use for to replace a char with another in char txt[100]; in same mode for CString CString str; str.Replace(_T(" "), _T(","));

  • Replace Single Char in a String 2014-09-30

    i have a string for example "hello, how are you?" what i want to be able to do is change the first char of the string for a different one, in this case a "H" so i can format the sentence.

  • Putting a single char inside a string 2013-03-06

    I have a function that builds an SQL statement based on arguments passed in. One argument is a single char, either 'Y' or 'N'. This value must be strategically placed into the statement such that the finished string looks like "UPDATE TableName SET C

  • String Question (find pos of some chars in a string) 2013-12-29

    I have a string Formula like this "12345.45 - 4354.34 + 2345.34 / 12.0 * 2.0" I need to find the postion for each operator in the string one by one. I am doing some thing like this.... but it seems it doesn't work right. This only works correct if th

  • getting only some values inside a string 2012-10-17

    using .... $freedisk = shell_exec (df -h | grep /usr); echo $freedisk; It returns me /dev/sda2 2.0G 1.6G 310M 84% /usr The problem is that on $freedisk I need only the percentuage (%) value 84% Anyone can tell me a fast way to extract only 84% from $

  • replace the \ char 2014-03-25

    people, anyone have a idea to replace the \ char into a string, like this >> $text = "blabla \\' blabla"; $text1 = "blabla ' blabla";

  • Replace Chars within a string 2012-04-01

    Whats the best way to replace chars within a string, and also spaces? Example. String = "This is $400 dollars that jimmy's mom owed me"; changes to this... string = "this_is_400_dollars_that_jimmy_s_mom_owed_me"; So i need to remove all the wacky cha

  • replace some corresponding letters from a string 2012-07-20

    I got a string(myString)which will be replaced some letter. and also i got another two of string, one is fromlatter="asdfghjkl.." , and another one is tolatter="olik90=ky...", the two strings of the fromlatter and to latter are same length, the lengt

  • passing char array as string 2012-01-19

    I've been working in C++ and java .... i m fond of using String data type .... but in C I've to use char array as string and have to pass it to a function as string its creating some confusions plz help void function( charArray comes here ){char loca

  • Oracle Is there any built-in/helper PL/SQL to replace special chars for XML ? 2012-05-02

    I have been using PL/SQL to write XML contents to browser. However, because my retrieved data (in the 8i Database) contains some special characters(e.g. &, >, etc.), I need to replace it everytime for output strings ... it's very inconvenient

  • Replace newline char with comma using jquery 2012-05-23

    frendz, I'm trying to replace newline char frm Google finance csv file with comma but its not happening pls help.

  • last char of a string 2012-07-04

    I just wanetd to know if there is some way of checking the last character of a string....tht is checking it without finding the length and goin thru the whole string.. Is there a predefined function in perl tht returns the last char of a string witho

  • How to get char* from a string ? 2012-08-27

    I am recoding to some existing functions and decided to start using string when much of the code uses char*. char* foo() { string s("stand in for a function call"); return s.c_str(); } The line string s("stand in for a function call"); is just a stan

  • Replacing the default paramter prompt strings 2012-09-03

    The crystal reports that I develop are hosted on a server using JAva/JSP. I use parameters in the report. When the link for the report is clicked. A page requesting for the parameter is thrown at the user. This page has some default strings like 'The

  • php code inside a string? 2013-05-17

    How can I put php code inside a string? I need to write some php code to a file..... but can't seem to figure out how to escape the php tags.... here is what I have so far... <? $data = " <? \$feature1 = \"$feature1enter\"; \$feature2 = \"$feat

  • Search a listbox as u type some chars! 2013-10-05

    Hy guys , i want to add a feature to my program so users can search for listbox items by typing some chars, (not in a textbox,i don't know where the code retains them) and automaticly focus the item found..if one :) And if there is no action from key

  • how to execute arithmetic operations inside a string 2013-12-20

    i've been having some trouble with a program i'm doing. The fact is that i retrieve a series of numeric operations inside a string as a parameter and i need to know their value , for example , i have into a string variable the next values " (200*16)/

  • Replacing Illegal chars??? 2014-01-22

    Howdy Gang, I need to test a string for characters outside the ASCII norms. Then replace that char with the notation equivalent so that it will load in XML. Example string: "Use the form <hey> in your code" would be "use the form $lt;hey&gt

  • Replacing a char 2014-09-05

    I am trying t o replace just one char in a string. However, when I try to use the Replace function in the below context (newTimeStamp being 20-something characters long): newTimeStamp = Replace(newTimeStamp, "5", " ",4,1) It truncates my string by 8