How to replace a character in a string with blank space.
Hi,
How to replace a character in a string with blank space.
Note:
I have to change string CL_DS_1===========CM01 to CL_DS_1 CM01.
i.e) I have to replace '=' with ' '.
I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp_fill_string WITH ' '</b>
Its not working.
Hi,
Try with this..
call method textedit- >replace_all
exporting
case_sensitive_mode = case_sensitive_mode
replace_string = replace_string
search_string = search_string
whole_word_mode = whole_word_mode
changing
counter = counter
exceptions
error_cntl_call_method = 1
invalid_parameter = 2.
<b>Parameters</b> <b> Description</b> <b> Possible values</b>
case_sensitive_mode Upper-/lowercase false Do not observe (default value)
true Observe
replace_string Text to replace the
occurrences of
SEARCH_STRING
search_string Text to be replaced
whole_word_mode Only replace whole words false Find whole words and
parts of words (default
value)
true Only find whole words
counter Return value specifying how
many times the search string
was replaced
Regards,
Jayaram...
Similar Messages
-
How to replace a character in a string
Hello Powerusers
First i'me new in the applescripting so hope you can tell me a few hint to get on.
I Have been trying to find a way to replace characters in a string using applescript. but with no luck
Anybody having a script that can give me a clue on this.
I'me normally programming in windows.... yeah i know there is a first time for everything.Okay i solved my problem but why arent the folder renamed?
property oldfolder : ""
property newfolder : ""
property SS : "."
property RS : " "
to replaceText(someText, oldItem, newItem)
replace all occurances of oldItem with newItem
parameters - someText [text]: the text containing the item(s) to change
oldItem [text, list of text]: the item to be replaced
newItem [text]: the item to replace with
returns [text]: the text with the item(s) replaced
set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}
try
set {itemList, AppleScript's text item delimiters} to {text items of someText, newItem}
set {someText, AppleScript's text item delimiters} to {itemList as text, tempTID}
on error errorMessage number errorNumber -- oops
set AppleScript's text item delimiters to tempTID
error errorMessage number errorNumber -- pass it on
end try
return someText
end replaceText
tell application "Finder"
set these_items to the selection
end tell
repeat with i from 1 to the count of these_items
set this_item to (item i of these_items) as alias
set this_info to info for this_item
set oldfolder to name of this_info
set newfolder to replaceText(oldfolder, SS, RS)
set name of this_info to newfolder
end repeat -
Replace hex character in a string with another hex character
Hi Guys,
Heres a problem scenario, hex character 92 looks very much like hex character 27 (apostrophe).
I need to write a program that can replace all hex character 92 to hex 27 in a string.
Being a novice on the regular expressions, I would appreciate if somebody can show
the exact syntax to to perform this replacement.
Many Thanks
-AnilI don't think you need to use regex to do this:
String s = something();
char a = 0x27;
char b = 0x92;
s.replace(a,b);
And don't forget that since Strings are immutable you need:
s = s.replace(a,b);to do anything useful. -
Replace the first character in a String with blank
String a = dgramRsp.getAddress().toString();
a = a.replace('/','');The problem with the first statement is that it returns an ip address with a '/' in front of it. Like so.../192.168.0.190
I need to get rid of the '/'. The replace won't work because it wants a character between the ' '. Thanks for your time.I had to think about it for a sec but yes you're
right.
InetAddress a = dgramRsp.getAddress();
String b = a.getHostAddress();
substring(1) would have worked, too, but it would have been redundant (removing a previously added slash). -
Replacing a character in a string to another character
hi,
i need to write a function or procedure to replace the character of a string value suppose:
l_error:= 'abcdefghijklmnop' is a string
i need write a function or procedure to replace the character "c" to "z"
that data in l_error is not in any table.
thanks,
AJI want to Replace all the Existence of the word - "Test" in a string with "Test1" whereever a space exits before the word Test and someother alphabet after "Test" i.e. Test will be replaced with Test1 if a word starts with Test and contains more alphabets also. For example - TestName should be replaced with Test1Name while MyTest should not be updated to MyTest1.
I have tried to use below query which uses oracle regular expressions -
SELECT REGEXP_REPLACE('MYCOMPANY TEST TESTGEET INDIA PVT LTD TEST','\s(TEST)\w',' TEST1') FROM DUAL
Output -
"MYCOMPANY TEST *TEST1EET* INDIA PVT LTD TEST"
Here, it has also replaced the G also from TESTGEET and resulted in TEST1EET while i want TEST1GEET.
Can someone please suggest how can i do this..... may b m doing some silly mistake but sorry m a newbie to regular expression...
Thanks in advance.. -
Replace a character in a string
Hi,
I've been tearing my hair out trying to do something very simple, replace a backslash character in a string with an underscore. I've searched online and discovered the -replace parameter which you would think would work fine but no, it seems to get in a
tizzy because the character I want to replace is a backslash and I get an error: "Invalid regualr expression pattern".
Here's what I have which produces the error:
$str = 'start\end'
$str = $str -replace '\','_'
Can someone tell me how to do this? I simply want to replace a backslash with an underscore.
thanks
Jamie
http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About mesod's law. I spend half an hour trying to figure this out and then as soon as I post this thread I figure it. The following works:
$str = 'start\end'
$str = $str -replace '\\','_'
$str
http://sqlblog.com/blogs/jamie_thomson/ |
@jamiet |
About me
"-replace" requires a regular expression for each argument, which is why you needed to escape your backslash with another backslash. If you use the replace() string method, you are not required to use regular expressions:
$str = $str.replace('\','_') will work exactly as you expect it to. -
Replace a character in the string using JavaScript
Hello,
I would like to ask for help. I have a field in the xml file, which contains a string, that is bound to a text box on the form.
What would be the syntax to replace a special character in the string with the carriage return?
Thank you.Huh?
I didn't post my script...
It sure is no clean programming since I just took Steve's solutions and delted the ligns I didn't want (the app allert)
Though in the end I've taken the boolean out, or better replaced it with the replacement function, it repeats the replacement no matter how much "ü"'s are in there. (I needed the boolean though, since as long as it was true, the if should be executed.)
Somehow it worked... not 100% sure why, but it worked.
if (findChar(this.rawValue)) {
function findChar(str)
{ for (var i=0; i < str.length; i++)
if (str.charAt(i) == "ü")
this.rawValue = this.rawValue.replace(/ü/,"ue") -
Replacing a special character in a string with another string
Hi
I need to replace a special character in a string with another string.
Say there is a string - "abc's def's are alphabets"
and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
"abc&apos&s def&apos&s are alphabets" .
Kindly let me know how this requirement can be met.
Regards
SukumariREPLACE
Syntax Forms
Pattern-based replacement
1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
pattern
IN [section_of] dobj WITH new
[IN {BYTE|CHARACTER} MODE]
[{RESPECTING|IGNORING} CASE]
[REPLACEMENT COUNT rcnt]
{ {[REPLACEMENT OFFSET roff]
[REPLACEMENT LENGTH rlen]}
| [RESULTS result_tab|result_wa] }.
Position-based replacement
2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
[IN {BYTE|CHARACTER} MODE].
Effect
This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
System fields
sy-subrc Meaning
0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
4 The subsequence in sub_string was not found in dobj in the pattern-based search.
8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
Note
These forms of the statement REPLACE replace the following obsolete form:
REPLACE sub_string WITH
Syntax
REPLACE sub_string WITH new INTO dobj
[IN {BYTE|CHARACTER} MODE]
[LENGTH len].
Extras:
1. ... IN {BYTE|CHARACTER} MODE
2. ... LENGTH len
Effect
This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
System Fields
sy-subrc Meaning
0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
Note
This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
Addition 1
... IN {BYTE|CHARACTER} MODE
Effect
The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
Addition 2
... LENGTH len
Effect
If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
Example
After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
DATA: text1 TYPE string VALUE 'I know you know',
text2(18) TYPE c LENGTH 18 VALUE 'I know you know',
sub_string TYPE string VALUE 'know',
new TYPE string VALUE 'should know that'.
REPLACE sub_string WITH new INTO text1.
REPLACE sub_string WITH new INTO text2. -
Replacing a part of a String with a new String
Hi everybody,
is there a option or a method to replace a part of a String with a String???
I only found the method "replace", but with this method I only can replace a char of the String. I don't need to replace only a char of a String, I have to replace a part of a String.
e.g.:
String str = "Hello you nice world!";
str.replace("nice","wonderfull"); // this won't work, because I can't replace a String with the method "replace"
// with this method I'm only able to replace charsDoes anyone know some method like I need???
Thanks for your time on answering my question!!
king regards
IceCube-Ddo check java 1.4 api, I think there is a method in it, however for jdk1.3 you can use
private static String replace(String str, String word,String word2) {
if(str==null || word==null || word2 == null ||
word.equals("") || word2.equals("") || str.equals("")) {
return str;
StringBuffer buff = new StringBuffer(str);
int lastPosition = 0;
while(lastPosition>-1) {
int startIndex = str.indexOf(word,lastPosition);
if(startIndex==-1) {
break;
int len = word.length();
buff.delete(startIndex,startIndex+len);
char[] charArray = word2.toCharArray();
buff.insert(startIndex,charArray);
str = buff.toString();
int len2 = startIndex+word2.length();
lastPosition = str.indexOf(word,len2);
return buff.toString(); -
Replace multiple whitespaces in a string with single one
Hi,
I'm using Oracle 9.2.0 and I have a query on string manipulation.
Can I replace multiple whitespaces within a string with single one. I tried with regexp_replace function but it is not supporting Oracle 9i.
Can someone help me out?
Regards,
PramodJust playing around:
WITH
Strings
AS
SELECT 'Can I replace multiple whitespaces within a string with single one' Text FROM Dual
SELECT
REPLACE
REPLACE
XMLAGG
XMLElement
"A",
SubStr(Text, Level, 1)
'</A>'
'<A>'
) Text
FROM
Strings
WHERE
NOT
Level > 1
AND SubStr(Text, Level, 1) = ' '
AND SubStr(Text, Level - 1, 1) = ' '
CONNECT BY
Level <= LENGTH(Text); -
does anyone have step by step instructions for how to replace .sparsebundle to make time capsule with time machine work again. i accidently deleted it thank you
Error message Pop-up reads:
Time Machine could not complete the backup
The backup disk image "/Volumes/Data-1/myname.sparsebundle" could not be accessed (error - 1) -
Replacing # with blank space in Bex Analyser
Hi All,
Can any one help me out in replacing # values in Bex analyser with blank space.
I tried with the macro:
Sub SAPBEXonRefresh(queryID As String, resultArea As Range)
' First Query in the workbook
If queryID = "SAPBEXq0001" Then
' Selects the area where the report query is rendered
resultArea.Select
'Replace "" with 0
Selection.Cells.Replace What:="", Replacement:="0", LookAt:=xlWhole, _ SearchOrder:=xlByRows, MatchCase:=False, MatchByte:=True
End If
End Sub
Means I have include the macro to the Excel, but still it is not working.
If this macro is the correct solution, then may be I am not using it properly(in the sense I'm not calling with proper syntax).
Please provide me with the solutiuon to get rid of this problem.Hi,
We are using BEX 7.0.
I got a macro code which is working. The code is as follows.
Dim resultArea As Range
Set resultArea = varname(1)
Dim c As Range
For Each c In resultArea.Cells
If c.Value = "#" Then c.Value = " "
Next c
This works fine but the problem is that this macro code should be added each and every time when the query is run.
Can any one suggest me where the code can be added in Bex Analyzer itself, so that when the query is run the above macro runs along with it and removes the #.
Thanks and Regards,
Geetha. -
Adobe Pro XI deletes and/or replaces letters with blank spaces or an x
How do I fix the problem where Adobe Pro XI deletes and/or replaces letters with blank spaces or an x.
This is really annoying to have to go back to each thing I type into a document and re-choose the fonts to get them to be correct.
Thanks for your help!Adobe is a company, not a program... do you mean ACROBAT Pro?
If yes, this is the Premiere Pro video editing forum, you need to go to http://forums.adobe.com/community/acrobat -
Replacing a character in a String
Hi All,
How can I replace a character ' which appears in a String into \'There is a method in String that replaces all
occurrences of one character with anothercharacter.
It's called, hold your breath now, "replace".But tho OP wants to replace one character with two
characters :)You're right, I missed that. Well, serves me right for being sarcastic. :-) -
Replace a character from a string
Hi,
how can I replace a particular character from a string on a particular occurrence? Say for eg, if i wan to replace 'a' of second occurrence from 'abcabcabc', then what should i do? I guess the normal REPLACE function replaces every occurrence in a given string. So is there any other way to solve this?
Thanks!If you are in 9i:
Then you got to split the string into based on the nth position.
SQL> select replace('abddefabc','a','x') from dual;
REPLACE('
xbddefxbc
SQL> select instr('abddefabc','a',2) from dual;
INSTR('ABDDEFABC','A',2)
7
SQL> select substr('abddefabc',1,instr('abddefabc','a',2)-1),substr('abddefabc',instr('abddefabc','a',2)) from dual;
SUBSTR SUB
abddef abc
SQL> select substr('abddefabc',1,instr('abddefabc','a',2)-1),replace(substr('abddefabc',instr('abddefabc','a',2)),'a','X') as replaced from dual;
SUBSTR REP
abddef XbcOfcourse, later on you can join the string..
Jithendra
Maybe you are looking for
-
Changing of Sales Employee in Sales order
Dear Experts, We wish to disable the changing of Sales employee in a sales order in VA02 mode. However, in VA01 we need to keep it open for editing. We have also tried through the customising in partner determination procedure but could not achieve t
-
Streaming all sound from ipad to mac mini
Hi I use several apps and sites on my ipad to look for and discover new music Id like to find a way to stream all the sound from the ipad to my macmini, which is connected to my sound system Is it possible and what do i need to do Thanks
-
Solaris 10 Install - 10/09 version - screen resolution
Hi guys: I just installed an x86 version of Solaris 10 10/09 onto Lenovo T61. GUI install would not come up, so I used a command line mode. It turned out that Solaris used a greater video resolution than 1024 and my screen does not handle that. What
-
How to display xml sting as tree , using af:tree
Hi, i need to display a xml string stored in the data base table, as a xml tree in GUI. I understand ADF having a component called <af:tree> . It expects input data as "oracle.adf.view.faces.model.TreeModel" type. how to convert the string format of
-
SD Variant Configuration with manual entry cut length variant
Hi Expert, I have one scenario in variant configuration where client want to put one variant value manually and according to entry price variant for example 4 M cut length should pick up automatically in variant pricing. Please check below example. X