Replace " with ' in a string

I need to replace " with '.
Does any have a solution? The follwing code has a problem to define
sString replace =""";
public String replace(String str, String pattern, String replace) {
int s = 0;
int e = 0;
StringBuffer result = new StringBuffer();
while ((e = str.indexOf(pattern, s)) >= 0) {
result.append(str.substring(s, e));
result.append(replace);
s = e+pattern.length();
result.append(str.substring(s));
return result.toString();
Thanks.
Jian

use "\"" instead

Similar Messages

  • To replace "\" with "/" in a string using FrameMaker API

    How to replace "\folder1\folder2\folder3" with "folder1/folder2/folder3" using framemaker API ?

    Hi Asha,
    Here is a function that I use for substring replacement, using all FDK library functions. If you use standard C libraries instead, you could probably reduce this to a line or two.
    To use it, you would send something like:
    path = F_StrCopyString("\\folder1\\folder2\\folder3");
    strReplace(path, "\\", "/", False);
    There might be better ways to do this. I'm not really that much of a programmer.
    Russ
    //returns the index of the first change, or -1 if no changes.
    IntT ws_StrReplace(StringT *mainString,
                       StringT searchString,
                       StringT replaceString,
                       IntT considerCase)
      StringT strBuf,
        returnString,
        appendString;
      IntT i,
        firstIndex = -1;
      //if the search string is empty, there is nothing to do.
      if(F_StrIsEmpty(searchString))
        returnString = F_StrCopyString(*mainString);
      else
        //otherwise, initialize the buffer
        returnString = F_StrCopyString("");
        for(i = 0; i < F_StrLen(*mainString); i++)
          strBuf = F_StrCopyString(*mainString);
          //Truncate the string from the beginning
          F_StrReverse(strBuf, 10000);
          F_StrTrunc(strBuf, (F_StrLen(strBuf) - i));
          F_StrReverse(strBuf, 10000);
          //and lop it down to the size of the search string
          if(F_StrLen(strBuf) > F_StrLen(searchString))
            F_StrTrunc(strBuf, F_StrLen(searchString));
          //if they are the same, we are doing the replacement
          if((considerCase && F_StrCmp(strBuf, searchString) == 0) ||
             (!considerCase && F_StrICmp(strBuf, searchString) == 0))
            appendString = F_StrCopyString(replaceString);
            //set the return value
            if(firstIndex < 0) firstIndex = i;
            //jimmy the loop so we step past the length of the replacement
            //string the next time around
            i += F_StrLen(searchString) - 1;
          //otherwise, we are just appending 1 character on.
          else
            F_StrTrunc(strBuf, 1);
            appendString = F_ApiCopyString(strBuf);
          //now, concatenate
          //rciReturnString = F_Realloc(rciReturnString,
            //F_StrLen(rciReturnString) + F_StrLen(rciAppendString), NO_DSE);
           returnString = (StringT) F_Realloc(returnString,
            (F_StrLen(returnString) + F_StrLen(appendString))*sizeof(StringT), NO_DSE);
          F_StrCat(returnString, appendString);
          F_ApiDeallocateString(&strBuf);
          F_ApiDeallocateString(&appendString);
        } //end main else
      //all done
      F_ApiDeallocateString(mainString);
      *mainString = F_StrCopyString(returnString);
      F_ApiDeallocateString(&returnString);
      return firstIndex;

  • I want to replace "\" with "/" in a string.

    I tried this...
    String whatever = myString.replace("\\", "/");
    ...and this...
    String whatever = myString.replace("\", "/");
    ...but I get an error.
    I was able to get it to work doing it this way...
    String slashStr = "\\/";
    char slashArr[] = slashStr.toCharArray();
    whatever = whatever.replace(slashArr[0], slashArr[1]);
    But I think that is silly.
    Can someone tell me why the first method won't work?

    String whatever = myString.replace("\\", "/");
    String.replace
    ...and this...
    String whatever = myString.replace("\", "/");
    ...but I get an error.This is correct. There is no method String.replace(String,String)
    only String.replace(char,char)
    I was able to get it to work doing it this way...
    String slashStr = "\\/";
    char slashArr[] = slashStr.toCharArray();
    whatever = whatever.replace(slashArr[0], slashArr[1]);
    But I think that is silly.It is a bit.
    String s1 = "This\\Is\\The\\Original";
    String s2 = s1.replace('\\','/');
    ...Or something like that... Single quotes indicate a char literal
    - double-quotes indicate a string literal.
    Talden

  • 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-D

    do 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();

  • Search given string array and replace with another string array using Regex

    Hi All,
    I want to search the given string array and replace with another string array using regex in java
    for example,
    String news = "If you wish to search for any of these characters, they must be preceded by the character to be interpreted"
    String fromValue[] = {"you", "search", "for", "any"}
    String toValue[] = {"me", "dont search", "never", "trip"}
    so the string "you" needs to be converted to "me" i.e you --> me. Similarly
    you --> me
    search --> don't search
    for --> never
    any --> trip
    I want a SINGLE Regular Expression with search and replaces and returns a SINGLE String after replacing all.
    I don't like to iterate one by one and applying regex for each from and to value. Instead i want to iterate the array and form a SINGLE Regulare expression and use to replace the contents of the Entire String.
    One Single regular expression which matches the pattern and solve the issue.
    the output should be as:
    If me wish to don't search never trip etc...,
    Please help me to resolve this.
    Thanks In Advance,
    Kathir

    As stated, no, it can't be done. But that doesn't mean you have to make a separate pass over the input for each word you want to replace. You can employ a regex that matches any word, then use the lower-level Matcher methods to replace the word or not depending on what was matched. Here's an example: import java.util.*;
    import java.util.regex.*;
    public class Test
      static final List<String> oldWords =
          Arrays.asList("you", "search", "for", "any");
      static final List<String> newWords =
          Arrays.asList("me", "dont search", "never", "trip");
      public static void main(String[] args) throws Exception
        String str = "If you wish to search for any of these characters, "
            + "they must be preceded by the character to be interpreted";
        System.out.println(doReplace(str));
      public static String doReplace(String str)
        Pattern p = Pattern.compile("\\b\\w+\\b");
        Matcher m = p.matcher(str);
        StringBuffer sb = new StringBuffer();
        while (m.find())
          int pos = oldWords.indexOf(m.group());
          if (pos > -1)
            m.appendReplacement(sb, "");
            sb.append(newWords.get(pos));
        m.appendTail(sb);
        return sb.toString();
    } This is just a demonstration of the technique; a real-world solution would require a more complicated regex, and I would probably use a Map instead of the two Lists (or arrays).

  • String Param tag replace with Br tag

    original text:
    <P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
    I need to: <br/>sample text1<br2>sample text2<br2>sample text3
    can help me

    var reg:RegExp = /\<\/?P.*?\/?\>/igm;
      var _m=messageField.htmlText//<P ALIGN="LEFT">sample text1</P><P ALIGN="LEFT">sample text2</P><P ALIGN="LEFT">sample text3</P>
      _m=_m.replace(reg, '<br/>');
    trace(_m) //  "<br/>sampletext1<br/><br/>sampletext2<br/><br/>sampletext3<br/>"
    Iam getting double breaks i need only one break.
    Re: String Param tag replace with Br tag 

  • Find and replace value in Delimited String

    Hi All,
    I have a requirement, where i need to find and replace values in delimited string.
    For example, the string is "GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~". The 4th column gives month and year. I need to replace it with previous month name. For example: "GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~". I need to do same for last 12 months.
    I thought of first devide the values and store it in variable and then after replacing it with required value, join it back.
    I just wanted to know if there is any better way to do it?

    for example (Assumption: the abbreviated month is the first occurance of 3 consecutive alphabetic charachters)
    with testdata as (
    select 'GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}') part
    ,to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}')
             ,to_char(add_months(to_date('01'||regexp_substr(str, '[[:alpha:]]{3}')||'2013', 'DDMONYYYY'),-1),'MON')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~FEB-13~CREDIT~A~N~USD~NULL~
    FEB
    02/01/2013
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    with year included
    with testdata as (
    select 'GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~' str from dual
    select
    str
    ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}') part
    ,to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY') part_date
    ,replace (str
             ,regexp_substr(str, '[[:alpha:]]{3}-\d{2}')
             ,to_char(add_months(to_date(regexp_substr(str, '[[:alpha:]]{3}-\d{2}'), 'MON-YY'),-1),'MON-YY')
    ) res
    from testdata
    STR
    PART
    PART_DATE
    RES
    GL~1001~157747~JAN-13~CREDIT~A~N~USD~NULL~
    JAN-13
    01/01/2013
    GL~1001~157747~DEC-12~CREDIT~A~N~USD~NULL~
    Message was edited by: chris227 year included

  • Find and replace with multiple files and with a watch folder

    I am trying to create a watch folder that uses red_menace script to:
    1. Have a folder that receives multiple xml files that run the script one by one.
    2. then move the files to an output folder.
    I tried modifying the set TheFIle to choose file -- the original text file to:
    with multiple selections allowed
    But that doesn't seem to work. I know i'm missing a step. Any help is much appreciated!
    Thanks!
    The way i'd like to setup things is having an input folder on the desktop (or just have the application on the desktop and I can drag the files onto it), and let it do it's thing. Once it's done have it export the xml files into an output folder.
    Here's what i got so far:
    on open
    set TheFIle to choose file -- the original text file
    set TheFolder to ("Macintosh HD:Users:user1:Desktop:out") -- the folder for the output file
    set TheName to (GetUniqueName for TheFIle from TheFolder) -- the name for the output file
    set TheText to read TheFIle -- get the text to edit
    set Originals to {"KPCALDATE", "KPCALEVENT", "KPCALDAY", "KPCALBODY", "obituaries name", "" & return & "</cstyle></pstyle>" & return & "<pstyle name=\"obituaries text\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>", " .com", " .net", " .org", " .edu", "www .", "www. ", "Ho- nolulu", "<pstyle name=\"kicker 12\"><cstyle allcaps=\"1\">fashion news</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "<component name=\"Headline 1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline 1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 36\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>-", "-", "
    Per serving:", "<pstyle name=\"Titlebar - mini, red\"><cstyle allcaps=\"1\">NATION & World </cstyle><cstyle allcaps=\"1\">Report</cstyle><cstyle allcaps=\"1\">" & return & "</cstyle></pstyle>" & return & "", "</cstyle></pstyle>"} -- the terms that can be replaced
    set Replacements to {"subhed", "subhed", "subhed", "Normal", "obituaries text", ", ", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\" font=\"ADV AGBook-Medium 2\">", "<pstyle name=\"Recipe Ingredients\"><cstyle>
    ", ".com", ".net", ".org", ".edu", "www.", "www.", "Honolulu", "", "<component name=\"Headline1\" type=\"Headline\">" & return & "<header>" & return & "<field name=\"Component name\" type=\"string\" value=\"Headline1\"/>" & return & "<field name=\"Component type\" type=\"popup\" value=\"Headline\"/>" & return & "</header>" & return & "<body>" & return & "<pstyle name=\"hed STANDARD 27\"><cstyle>", "<pstyle name=\"obituaries text\"><cstyle allcaps=\"1\">", "<pstyle name=\"obituaries text\"><cstyle name=\"Graphics Bold leadin\">", "<pstyle name=\"tagline\"><cstyle>—", " —", "
    Per serving:", "","" & return & "</cstyle></pstyle>"} -- the replacement terms
    repeat with AnItem from 1 to count Originals
    set TheText to (replaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
    end repeat
    try -- write a new output file
    tell application "Finder" to make new file at TheFolder with properties {name:TheName}
    set OpenFile to open for access (result as alias) with write permission
    write TheText to OpenFile starting at eof
    close access OpenFile
    on error errmess
    try
    log errmess
    close access OpenFile
    end try
    end try
    end open
    to GetUniqueName for SomeFile from SomeFolder
    check if SomeFile exists in SomeFolder, creating a new unique name if needed
    parameters - SomeFile [mixed]: a source file path
    SomeFolder [mixed]: a folder to check
    returns [text]: a unique file name and extension
    set {Counter, Divider} to {"00", "_"}
    -- get the name and extension
    set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
    if TheExtension is missing value then set TheExtension to ""
    set TheName to text 1 thru -((count TheExtension) + 2) of TheName
    set NewName to TheName & "." & TheExtension
    tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
    repeat while it contains NewName
    set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
    set NewName to TheName & Divider & Counter & "." & TheExtension
    end repeat
    end tell
    return NewName
    end GetUniqueName
    to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
    displays a dialog for multiple item edit (note that a return is used between each edit item)
    for each of the items in SomeItems, a line containing it's text is placed in the edit box
    the number of items returned are padded or truncated to match the number of items in SomeItems
    parameters - SomeItems [list]: a list of text items to edit
    TheTitle [boolean/text]: use a default or the given dialog title
    ThePrompt [boolean/text]: use a default or the given prompt text
    returns [list]: a list of the edited items, or {} if error
    set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
    if TheCount is less than 1 then return {} -- error
    if ThePrompt is in {true, false} then -- "with" or "without" Prompt
    if ThePrompt then
    set ThePrompt to "Edit the following items:" & return -- default
    else
    set ThePrompt to ""
    end if
    else -- fix up the given prompt a little
    set ThePrompt to ThePrompt & return
    end if
    if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
    set TheTitle to "Multiple Edit Dialog" -- default
    else
    set TheTitle to ""
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
    set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
    repeat with AnItem from 1 to TheCount -- pad/truncate entered items
    try
    set the end of TheItems to (item AnItem of TheInput)
    on error
    set the end of TheItems to ""
    end try
    end repeat
    return TheItems
    end EditItems
    to replaceText of SomeText from OldItem to NewItem
    replace all occurances of OldItem with NewItem
    parameters - SomeText [text]: the text containing the item(s) to change
    OldItem [text]: the item to be replaced
    NewItem [text]: the item to replace with
    returns [text]: the text with the item(s) replaced
    set SomeText to SomeText as Unicode text -- TID's are case insensitive with Unicode text
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, OldItem}
    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}
    return SomeText
    end replaceText
    Message was edited by: gamebreakers

    When you use the open or adding folder items to handlers, you need to add the parameters for the file items passed to them.
    I'll go ahead and post the applet/droplet version of my original script from the previous topic for reference:
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFEE80;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- search and replace multiple items applet/droplet/folder action
    -- the terms to replace - edit as needed
    property EditableItems : {¬
    "one", ¬
    "two", ¬
    "three", ¬
    "four", ¬
    "five", ¬
    "six", ¬
    "seven", ¬
    "eight", ¬
    "nine", ¬
    "ten", ¬
    "eleven", ¬
    "twelve", ¬
    "thirteen", ¬
    "fourteen", ¬
    "fifteen", ¬
    "sixteen", ¬
    "seventeen", ¬
    "eighteen", ¬
    "nineteen", ¬
    "twenty"}
    -- the folder for the output file(s) - change as needed
    property TheFolder : (path to desktop)
    property LastEditItems : EditableItems
    on run
    the applet/droplet was double-clicked
    open (choose file with multiple selections allowed)
    end run
    on open TheItems
    items were dropped onto the applet/droplet
    parameters - TheItems [list]: a list of the items (aliases) dropped
    returns nothing
    repeat with AnItem in TheItems
    ReplaceMultipleItems from AnItem
    end repeat
    end open
    on adding folder items to this_folder after receiving these_items
    folder action - items were added to a folder
    parameters - this_folder [alias]: the folder added to
    these_items [list]: a list if items (aliases) added
    returns nothing
    repeat with AnItem in these_items
    ReplaceMultipleItems from AnItem
    end repeat
    end adding folder items to
    to ReplaceMultipleItems from SomeFile
    replace multiple text items in SomeFile
    parameters - SomeFile [alias]: the file to replace items in
    returns nothing
    set TheName to (GetUniqueName for SomeFile from TheFolder) -- the name for the output file
    set TheText to read SomeFile -- get the text to edit
    set Originals to (choose from list EditableItems default items LastEditItems with prompt "Select the terms to replace:" with multiple selections allowed) -- the specific terms to replace
    set LastEditItems to Originals
    set Replacements to (EditItems of Originals with Title given Prompt:"Edit the following replacement terms:") -- the replacement terms
    repeat with AnItem from 1 to count Originals
    set TheText to (ReplaceText of TheText from (item AnItem of Originals) to (item AnItem of Replacements))
    end repeat
    try -- write a new output file
    tell application "Finder" to make new file at TheFolder with properties {name:TheName}
    set OpenFile to open for access (result as alias) with write permission
    write TheText to OpenFile starting at eof
    close access OpenFile
    on error errmess
    try
    log errmess
    close access OpenFile
    end try
    end try
    end ReplaceMultipleItems
    to GetUniqueName for SomeFile from SomeFolder
    check if SomeFile exists in SomeFolder, creating a new unique name if needed
    parameters - SomeFile [mixed]: a source file path
    SomeFolder [mixed]: a folder to check
    returns [text]: a unique file name and extension
    set {Counter, Divider} to {"00", "_"}
    -- get the name and extension
    set {name:TheName, name extension:TheExtension} to info for file (SomeFile as text)
    if TheExtension is in {missing value, ""} then
    set TheExtension to ""
    else
    set TheExtension to "." & TheExtension
    end if
    set {NewName, TheExtension} to {TheName, (ChangeCase of TheExtension to "upper")}
    set TheName to text 1 thru -((count TheExtension) + 1) of TheName
    tell application "System Events" to tell (get name of files of folder (SomeFolder as text))
    repeat while it contains NewName
    set Counter to text 2 thru -1 of ((100 + Counter + 1) as text) -- leading zero
    set NewName to TheName & Divider & Counter & TheExtension
    end repeat
    end tell
    return NewName
    end GetUniqueName
    to EditItems of SomeItems given Title:TheTitle, Prompt:ThePrompt
    displays a dialog for multiple item edit (note that a return is used between each edit item)
      for each of the items in SomeItems, a line containing it's text is placed in the edit box
        the number of items returned are padded or truncated to match the number of items in SomeItems
    parameters - SomeItems [list]: a list of text items to edit
    TheTitle [boolean/text]: use a default or the given dialog title
    ThePrompt [boolean/text]: use a default or the given prompt text
    returns [list]: a list of the edited items, or {} if error
    set {TheItems, TheInput, TheCount} to {{}, {}, (count SomeItems)}
    if TheCount is less than 1 then return {} -- error
    if ThePrompt is in {true, false} then -- "with" or "without" Prompt
    if ThePrompt then
    set ThePrompt to "Edit the following items:" & return -- default
    else
    set ThePrompt to ""
    end if
    else -- fix up the given prompt a little
    set ThePrompt to ThePrompt & return
    end if
    if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" Title
    set TheTitle to "Multiple Edit Dialog" -- default
    else
    set TheTitle to ""
    end if
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
    set {SomeItems, AppleScript's text item delimiters} to {SomeItems as text, TempTID}
    set TheInput to paragraphs of text returned of (display dialog ThePrompt with title TheTitle default answer SomeItems)
    repeat with AnItem from 1 to TheCount -- pad/truncate entered items
    try
    set the end of TheItems to (item AnItem of TheInput)
    on error
    set the end of TheItems to ""
    end try
    end repeat
    return TheItems
    end EditItems
    to ReplaceText of SomeText from OldItem to NewItem
    replace all occurances of OldItem with NewItem
    parameters - SomeText [text]: the text containing the item(s) to change
    OldItem [text]: the item to be replaced
    NewItem [text]: the item to replace with
    returns [text]: the text with the item(s) replaced
    set SomeText to SomeText as text
    if SomeText contains OldItem then
    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
    end try
    end if
    return SomeText
    end ReplaceText
    to ChangeCase of SomeText to CaseType
    changes the case or capitalization of SomeText to the specified CaseType using Python
    parameters - SomeText [text]: the text to change
    CaseType [text]: the type of case desired:
    "upper" = all uppercase text
    "lower" = all lowercase text
    "title" = uppercase character at start of each word, otherwise lowercase
    "capitalize" = capitalize the first character of the text, otherwise lowercase
    returns [text]: the changed text 
    set SomeText to SomeText as text
    if CaseType is not in {"upper", "lower", "title", "capitalize"} then return SomeText
    return (do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8')." & CaseType & "().encode('utf8')\" " & quoted form of SomeText)
    end ChangeCase
    </pre>
    Edit: how does the choose from list dialog handle those big strings? I'm guessing not very well - is that why you avoided using them?
    Message was edited by: red_menace

  • HT4191 Notes getting mixed up and or replaced with other users i-phone?

    For some reason whenever I sync my i-phone 4s and my wife syncs her i-phone 4 to itunes on our laptop which is a compaq(I don't know if that might be a problem) by the way, some of her notes always gets deleted and gets replaced with my notes, and she'll have just a couple of her notes but most of mine. It's been driving us crazy for months now cuz we can't figure it out! Do we need to sync our phones on different computers? Is there a setting that I'm missing? What are we doing wrong????

    Please let me know whether you experience the following issue, and submit feedback (or if you are an Apple Developer, a bug report). This issue is not related to synchronization.
    Title/Subject:
    Contacts 7.1 replaces one contact's Notes with another contact's Notes
    Summary:
    This issue's significance is severe because data is permanently lost: After searching for contacts and editing one of the contact's Notes, all found contacts' Notes are replaced with the changed contact's Notes.
    Steps to Reproduce:
    1. Launch the Contacts 7.1 app in OSX 10.8.2.
    2. Search for a string that appears in several contacts' Notes field.
    3. Click on one of the contacts in the search results.
    4. Ensure that "Edit Card" mode is NOT enabled.
    5. Alter the found string in the contact's Notes field.
    6. Click on a different contact in the search results list.
    Expected Results:
    The change is saved and the changed contact disappears from the search results list.
    Actual Results:
    All found contacts disappear from the search results list, and all found contacts' Notes are replaced with the changed contact's Notes.
    Regression:
    This issue did not exist in OSX 10.7's Address Book app. I have not had the opportunity to test earlier releases of OSX 10.8's Contacts app.
    Notes:
    Example:
    Suppose a search for "P1" finds three contacts:
      Name: Alan  |  Note: Ask permission. P1
      Name: Betsy  |  Note: Backup files. P1
      Name: Charles  |  Note: Call. P1
    While "Edit Card" mode is NOT enabled, in Alan's note, change "P1" to "P2". Then click on Betsy in the search results list. Betsy and Charles' Notes are erroneously and permanently replaced with Alan's Note:
      Name: Alan  |  Note: Ask permission. P2
      Name: Betsy  |  Note: Ask permission. P2
      Name: Charles  |  Note: Ask permission. P2

  • A little help with tokenizing a string

    Have most of this working and i will add the code to the end of the for you all to look at.
    Essentially what i am trying to do is tokenize a string that looks like:
    program int ABC, D;
         begin read ABC; read D;
              while (ABC != D) begin
                                       if (ABC > D) then ABC = ABC - D;
                                       else D = D - ABC;
                                  end;
                             end;
              write D;
         endMy tokeizing stuff works just fine for simpler version of this but it screws up a little when it gets to the "special symbols" that are a combination of more then one special token. The special symbols are:
    ; , = ! [ ] && or ( ) + - * != == < > <= >=Now i obviously have to look for those as tokenizing points, but the problem comes when i get to double ones like &&, or, !=, etc.
    I was wondering if there was a way to make it look for the combination != instead of just the ! and then the =.
    If there is not an easy way to do it what would be the best and easiest way to go about parsing that string into tokens? I am kinda leaning towards string.split but am not quite sure on how to set it up. some examples or pointers would be welcome!!
    Thanks and here is the code of the relevant part:
    import java.util.ArrayList;
    import java.util.StringTokenizer;
    import java.io.*;
    * @author Kyle Hiltner
    public class KHTokenizer implements KHTokenizerInterface
         private String current_token; //used to specify current token
         private int token_count=0; //used to keep track of which token is being asked for
         private ArrayList<String> file = new ArrayList<String>(); //stores the parsed input file
          * Creates a new KHTokenizer with the name of the file as input
          * @param inputFileName the specified file to be read from
          * @throws IOException
         KHTokenizer(String inputFileName) throws IOException
              FileReader freader = new FileReader(inputFileName); //create a FileReader for reading
              BufferedReader inputFile = new BufferedReader(freader); //pass that FileReader to a BufferedReader
              String theFile = Create_String_From_File(inputFile); //create a space separated string for easier tokenizing
              StringTokenizer tokenized_input_file = new StringTokenizer(theFile, ";=,()[] ", true); //tokenize the string using ;, =, and " " as delimiters
              String_Tokenizer(tokenized_input_file, file); //create the array by adding tokens
              this.current_token = file.get(this.token_count); //set the current token to the first in the array
         //----Private Operations----//
          * Determines if the specified word is a special Reserved word
          * @param reserved_word the current token
          * @return true if and only if the reserved_word is a Reserved Word
         private static Boolean Is_Reserved_Word(String reserved_word)
              //determine is reserved_word is one the established Reserved Words
              return ((reserved_word.equals("program")) || (reserved_word.equals("begin")) ||
                        (reserved_word.equals("end")) || (reserved_word.equals("int")) ||
                        (reserved_word.equals("if")) || (reserved_word.equals("then")) ||
                        (reserved_word.equals("else")) || (reserved_word.equals("while")) ||
                        (reserved_word.equals("read")) || (reserved_word.equals("write")));
          * Determines if the specified word is a Special Symbol
          * @param special_symbol the current token
          * @return true if and only if the special_symbol is a Special Symbol
         private static Boolean Is_Special_Symbol(String special_symbol)
              //determines if special_symbol is one of the established Special Symbols
              return ((special_symbol.equals(";")) || (special_symbol.equals(",")) ||
                        (special_symbol.equals("=")) || (special_symbol.equals("!")) ||
                        (special_symbol.equals("[")) || (special_symbol.equals("]")) ||
                        (special_symbol.equals("&&")) || (special_symbol.equals("or")) ||
                        (special_symbol.equals("(")) || (special_symbol.equals(")")) ||
                        (special_symbol.equals("+")) || (special_symbol.equals("-")) ||
                        (special_symbol.equals("*")) || (special_symbol.equals("!=")) ||
                        (special_symbol.equals("==")) || (special_symbol.equals("<")) ||
                        (special_symbol.equals(">")) || (special_symbol.equals("<=")) ||
                        (special_symbol.equals(">=")));
          * Determines if the specified token is an integer
          * @param integer_token the current token to be converted to an integer
          * @return true is and only if integer_token is an integer
         private static Boolean Is_Integer(String integer_token)
              Boolean is_integer=false; //set up boolean for check
              //try to convert the specified string to an integer
              try
                   int integer_token_value = Integer.parseInt(integer_token); //convert the string to an integer
                   is_integer = true; //set is_integer to true
              catch(NumberFormatException e) //if unable to parse the string to an integer set is_integer to false
                   is_integer = false; //set is_integer to false
              return is_integer; //return the integer
          * Determines if the specified token is an Identifier
          * @param identifier_token the current token
          * @return true if and only if the identifier_token is an identifier
         private static Boolean Is_Identifier(String identifier_token)
              //rule out that it is a Reserved Word, Special Symbol, or integer so then it must be an Identifier; so return true or false
              return ((!Is_Reserved_Word(identifier_token)) && (!Is_Special_Symbol(identifier_token)) && (!Is_Integer(identifier_token)));
          * Determines which value to assign to the specified token
          * @param which_reserved_word_token the current token
          * @return token_value the integer value relating to the Reserved Word token
         private static int Which_Reserved_Word(String which_reserved_word_token)
              int token_value=0; //set initial token_value
              //run through and check which Reserved word it is and then set it to the correct value
              if(which_reserved_word_token.equals("program"))
                   token_value = ReservedWords.PROGRAM.ordinal()+1;
              else if(which_reserved_word_token.equals("begin"))
                   token_value = ReservedWords.BEGIN.ordinal()+1;
              else if(which_reserved_word_token.equals("end"))
                   token_value = ReservedWords.END.ordinal()+1;
              else if(which_reserved_word_token.equals("int"))
                   token_value = ReservedWords.INT.ordinal()+1;
              else if(which_reserved_word_token.equals("if"))
                   token_value = ReservedWords.IF.ordinal()+1;
              else if(which_reserved_word_token.equals("then"))
                   token_value = ReservedWords.THEN.ordinal()+1;
              else if(which_reserved_word_token.equals("else"))
                   token_value = ReservedWords.ELSE.ordinal()+1;
              else if(which_reserved_word_token.equals("while"))
                   token_value = ReservedWords.WHILE.ordinal()+1;
              else if(which_reserved_word_token.equals("read"))
                   token_value = ReservedWords.READ.ordinal()+1;
              else
                   token_value = ReservedWords.WRITE.ordinal()+1;
              return token_value; //return the token_value
          * Determines which value to assign to the specified token
          * @param which_special_symbol_token the current token
          * @return special_symbol_token_value the integer value relating to the Special Symbol token
         private static int Which_Special_Symbol(String which_special_symbol_token)
              int special_symbol_token_value=0; //set initial value
              //check to figure out which Special Symbol it is and assign the correct value
              if(which_special_symbol_token.equals(";"))
                   special_symbol_token_value = SpecialSymbols.SEMICOLON.ordinal()+11;
              else if(which_special_symbol_token.equals(","))
                   special_symbol_token_value = SpecialSymbols.COMMA.ordinal()+11;
              else if(which_special_symbol_token.equals("="))
                   special_symbol_token_value = SpecialSymbols.EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("!"))
                   special_symbol_token_value = SpecialSymbols.EXCLAMATION_MARK.ordinal()+11;
              else if(which_special_symbol_token.equals("["))
                   special_symbol_token_value = SpecialSymbols.LEFT_BRACKET.ordinal()+11;
              else if(which_special_symbol_token.equals("]"))
                   special_symbol_token_value = SpecialSymbols.RIGHT_BRACKET.ordinal()+11;
              else if(which_special_symbol_token.equals("&&"))
                   special_symbol_token_value = SpecialSymbols.AND.ordinal()+11;
              else if(which_special_symbol_token.equals("or"))
                   special_symbol_token_value = SpecialSymbols.OR.ordinal()+11;
              else if(which_special_symbol_token.equals("("))
                   special_symbol_token_value = SpecialSymbols.LEFT_PARENTHESIS.ordinal()+11;
              else if(which_special_symbol_token.equals(")"))
                   special_symbol_token_value = SpecialSymbols.RIGHT_PARENTHESIS.ordinal()+11;
              else if(which_special_symbol_token.equals("+"))
                   special_symbol_token_value = SpecialSymbols.PLUS.ordinal()+11;
              else if(which_special_symbol_token.equals("-"))
                   special_symbol_token_value = SpecialSymbols.MINUS.ordinal()+11;
              else if(which_special_symbol_token.equals("*"))
                   special_symbol_token_value = SpecialSymbols.MULTIPLY.ordinal()+11;
              else if(which_special_symbol_token.equals("!="))
                   special_symbol_token_value = SpecialSymbols.NOT_EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("=="))
                   special_symbol_token_value = SpecialSymbols.EQUALS_EQUALS.ordinal()+11;
              else if(which_special_symbol_token.equals("<"))
                   special_symbol_token_value = SpecialSymbols.LESS_THAN.ordinal()+11;
              else if(which_special_symbol_token.equals(">"))
                   special_symbol_token_value = SpecialSymbols.GREATER_THAN.ordinal()+11;
              else if(which_special_symbol_token.equals("<="))
                   special_symbol_token_value = SpecialSymbols.LESS_THAN_OR_EQUAL_TO.ordinal()+11;
              else
                   special_symbol_token_value = SpecialSymbols.GREATER_THAN_OR_EQUAL_TO.ordinal()+11;
              return special_symbol_token_value; //return the correct value
          * Creates the string separated by white spaces to be read by the String Tokenizer
          * @param input_file the stream to be converted into a string
          * @return theFile the inputFile converted to a string
          * @throws IOException
         private static String Create_String_From_File(BufferedReader input_file) throws IOException
              String theFile="", keepReadingFromFile=""; //set initial value of the strings
              //run through the stream and create a file
              while(keepReadingFromFile != null)
                   keepReadingFromFile = input_file.readLine(); //read one line at a time
                   //if the line is null stop and break
                   if(keepReadingFromFile == null)
                        break;
                   else //keep reading from the file and make it into a string
                        theFile = theFile + keepReadingFromFile;
              theFile = theFile.replaceAll("\\t", " "); //remove any tabs from the string and replace with spaces so it is easier to Tokenize
              return theFile; //return the newly created string
          * Creates the array of tokens but tokenizing based on the given parameters
          * @param theInputFile
          * @param file to store the individual tokens in
         private void String_Tokenizer(StringTokenizer theInputFile, ArrayList<String> file)
              String token=""; //set up the intial token
              //keep reading with there is still more in the token stream
              while (theInputFile.hasMoreTokens())
                   token = theInputFile.nextToken(); //set token to the next token
                   //if the token is not a white sapce then add it to the array
                   if(!token.equals(" "))
                        file.add(token); //add token to the array
              file.add("nill"); //add a final spot to designate the end of the file
         //----Public Operations-----//
          * Returns the integer value of the current token
          * @return the integer value of the current token
         public int getToken()
              int token_number=0; //set initial value
              //determine if the current token is a Reserved Word, Special Symbol, Identifier, or nill (for end of file)
              if(Is_Reserved_Word(this.current_token))
                   token_number = Which_Reserved_Word(this.current_token); //determine the correct value for the Reserved Word
              else if(Is_Special_Symbol(this.current_token))
                   token_number = Which_Special_Symbol(this.current_token); //determine the correct value for the Special Symbol
              else if(Is_Integer(this.current_token))
                   token_number = 30; //the current token is an integer so set it to 30
              else if(this.current_token.equals("nill"))
                   token_number = 32; //the current token is nill so set it to 32
              else//(Is_Identifier(this.current_token))
                   token_number = 31; //the token is an identifer so set it to 31
              return token_number; //return the token_number
          * Sets the current token as the next one in line
         public void skipToken()
              //keep getting the next token as long as token_count is less then the size of the array
              if(this.token_count < file.size()-1)
                   this.token_count++; //increase token_count
                   this.current_token = file.get(token_count); // get the new token
          * This method can only be called to convert an integer in string form to its integer value.
          * If called on an non integer token an error is printed to the screen and execution of the Tokenizer is stopped.
          * @return integer value of the specified token assuming the token is an integer
         public int intVal()
              int integer_token_value=0; //set the initial value
              //if true is returned then go ahead and convert
              if(Is_Integer(this.current_token))
                   integer_token_value = Integer.parseInt(this.current_token); //parse the current_token string and get an integer value
              else // print he error message and exit Tokenizing
                   System.out.print("You called intVal() on a non-integer token. You tryed to convert the " );
                   if(Is_Reserved_Word(this.current_token))
                        System.out.print("reserved word " + "\"" + this.current_token +"\"" + " to an integer");
                   else if(Is_Special_Symbol(this.current_token))
                        System.out.print("special symbol " + "\"" + this.current_token +"\"" + " to an integer");
                   else
                        System.out.print("identifier " + "\"" + this.current_token +"\"" + " to an integer");
                   System.exit(1); //exit the system and quit tokenizing
              return integer_token_value; //return the current_token integer value
          * Returns a string if and only if the token is of the id type.
          * @return the name of the id token
         public String idName()
              String id_token_name=""; //setup the initial value
              //if the current_token is an Identifer then set it so and return it.
              if(Is_Identifier(this.current_token))
                   id_token_name = this.current_token;
              else // print message and quit tokenizing
                   System.out.print("You called idName() on ");
                   if(Is_Reserved_Word(this.current_token))
                        System.out.print("a reserved word, ");
                   else if(Is_Special_Symbol(this.current_token))
                        System.out.print("a special symbol, ");
                   else
                        System.out.print("an integer, ");
                   System.out.println("which is not an identifier token.");
                   System.exit(1); //exit and quit tokenizing
              return id_token_name; //return the id_token_name if possible
    }left some stuff out

    volunteers are supposed to read all that? and no tea and crumpets?
    Seriously though, we don't want to see all of your code, we don't even want to see most of your code, but rather you should condense your code into the smallest bit that still compiles, has no extra code that's not relevant to your problem, but still demonstrates your problem, in other words, an SSCCE (Short, Self Contained, Correct (Compilable), Example). For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]

  • Problem with conversion of strings like THISStr - this_str capitalization

    Problem with conversion of strings like. THISStr -> this_str
    Can anybody pass on the reverse code. I have one, but its faulty.
    public static String convertFromPolycaps(String str) {
              Pattern pattern = Pattern.compile("\\p{Upper}+");
              Matcher matcher = pattern.matcher(str);
              StringBuffer result = new StringBuffer();
              // We do manual replacement so we can change case
              boolean notFirst = false;
              int grpP = 0, grpA = 0;
              String last = "";
              String now = "";
              while (matcher.find()) {
                   grpA = matcher.end();
                   if (notFirst) {
                        now = matcher.group().substring(0).toLowerCase();
                        if (grpA - grpP > 1) {
                             matcher.appendReplacement(result, now);
                             result =
                                  new StringBuffer(
                                       result.substring(0, (result.length() - 1))
                                            + "_"
                                            + result.substring(result.length() - 1));
                        } else {
                             matcher.appendReplacement(result, "_" + now);
                   } else {
                        matcher.appendReplacement(result, matcher.group().substring(0).toLowerCase());
                        notFirst = true;
                   grpP = matcher.end();
                   ////index++;
                   last = now;
              matcher.appendTail(result);
              System.err.println(str + " : " + result.toString());
              return result.toString();
         }succesfully converts :
    AccountNmnc : account_nmnc
    CustNameJ : cust_name_j
    Resume : resume
    BeneBrCode : bene_br_code
    ApprovedPerson : approved_person
    but fails for:
    GLCode : glcode
    VISHALErrCode : vishalerr_code
    GHASUNNAcNo : ghasunnac_no

    Can anybody pass on the reverse code. I have one, but
    its faulty.Post it, I'm sure we can fix it...

  • XSLT mapping not working b'coz " " & " " replaced with and

    Hello Experts,
      I have a RFC to JMS scenario. One of the parameter of RFC is a string field. This field will contain the XML data in it.
    I need to create a complete XML payload using this data in a string field. For this I am using XSLT map :
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
         <xsl:output method="xml" omit-xml-declaration="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//Nem">
                   <xsl:copy-of select="."/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    This XSLT mapping works fine when tested independently.
    But in actual scenario at runtime the "<" & ">" used to indicate a node are getting replaced with < and >. Then the XSLT mapping fails and produces no output.
    The output of XSL will be passed in to a java mapping which signs the payload digitally.
    What is the issue with these signs? How can I overcome this problem?
    Any inputs will be of great help.
    Kind Regards,
    Abhijeet.
    Edited by: Abhijeet Ambekar on May 4, 2010 2:01 PM

    Hi Stefan,
      Yes - I want to get rid of & # 60. But these (& # 60 and & # 62) are not added by XSLT mapping. Rather they are in the input available to XSLT map.
    In sxmb_moni, i can see the inbound payload correctly :
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <P_SIGN_DOCUMENT />
      <P_XML_DOCUMENT><NemRefusionIndberetningSamling><NemRefusionIndberetningStruktur MessageID="1"><HeaderStruktur><SignOffIndikator>true</SignOffIndikator><TransaktionKode>Opret</TransaktionKode><IndberetningstypeKode>Anmeldelse</IndberetningstypeKode><FravaerTypeKode>Sygdom</FravaerTypeKode><FravaerendeStruktur><FravaerendeTypeKode>Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator>false</LoenUnderFravaerIndikator></FravaerendeStruktur><IndberetningUUIDIdentifikator>bf9cc44e-af15-4e19-8457-5845d75385d2</IndberetningUUIDIdentifikator><ReferenceAttributTekst>ref. Nielsen-1503831372 (23. oktober 2009)</ReferenceAttributTekst>
    but when I try to download the payload or right click on payload to view source I get something like below:
    <?xml version="1.0" encoding="UTF-8"?><rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><P_SIGN_DOCUMENT></P_SIGN_DOCUMENT><P_XML_DOCUMENT>& # 6 0;NemRefusionIndberetningSamling& # 62; & # 60;NemRefusionIndberetningStruktur MessageID="1"& #62;& #60;HeaderStruktur& #62;& #60;SignOffIndikator& #62;true& #60;/SignOffIndikator& #62;& #60;TransaktionKode& #62;Opret& #60;/TransaktionKode& #62;& #60;IndberetningstypeKode& #62;Anmeldelse& #60;/IndberetningstypeKode& #62;& #60;FravaerTypeKode& #62;Sygdom& #60;/FravaerTypeKode& #62;& #60;FravaerendeStruktur& #62;& #60;FravaerendeTypeKode& #62;Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator& #62;false</LoenUnderFravaerIndikator></FravaerendeStruktur& #62;<IndberetningUUIDIdentifikator& #62;bf9cc44e-af15-4e19-8457-5845d75385d2& #60;/IndberetningUUIDIdentifikator& #62;& #60;ReferenceAttributTekst& #62;ref. Nielsen-1503831372 (23. oktober 2009)& #60;/ReferenceAttributTekst& #62;
    (extra spaces added to "& # 60" as browser was converting it to < ,>)
    If i take the source code for payload and test XSLT mapping, it fails. But if I manually replace all "& # 60" with < and "& # 6 2" with >, then the mapping works fine.
    So I think for XSLT map to work correctly, we need to replace all "& # 60 " . Please suggest.
    Kind Regards,
    Abhijeet.

  • Problem in replacing with the unicode equivalent character ?

    Hello,
    I have a situation wherein i must replace
    m with \u3005
    n with \u3006
    o with \u3041
    etc ...,
    I get the codepoint value from the multibyte represenation .
    But the problem is
    I can not replace
    String temp="ename";
    temp.replace('m','\u3005');
    I am not allowed to hard code the value 3005, rather i am suppose to get the code point value from the multibyte representation.
    I have no problem in getting the code point value from the multibyte represenation.
    After i get the code point value i must concatenate the codepoint value with "\u"
    Currently i am following this implementation to do the replacement,
    String rp=null,snd;
    String tmp="ename";
    String hh="";
    for(int i=0;i<tmp.length();i++)
    snd=getCodepoint(tmp.charAt(i));
    if(snd!=null)
    rp=replace(String.valueOf(tmp.charAt(i)),
    String.valueOf(tmp.charAt(i)),"\\u"+snd);
    hh=hh+rp;
    else
    hh=hh+String.valueOf(tmp.charAt(i));
    //The replace method
    public static String replace(String source, String pattern, String replace)
    if (source!=null)
    final int len = pattern.length();
    StringBuffer sb = new StringBuffer();
    int found = -1;
    int start = 0;
    while( (found = source.indexOf(pattern, start) ) != -1)
    sb.append(source.substring(start, found));
    sb.append(replace);
    start = found + len;
    sb.append(source.substring(start));
    return sb.toString();
    else return "";
    Please tell me how to do the replacement
    Because when i display after the replacement is done i get
    e\u3006a\u3005e for the string "ename"
    where as i should be getting special characters in place of 'm' and 'n' in the string
    or i must atleast get e?a?e for the string "ename"
    Please do offer some suggesstions in this regard
    Your suggesstions would be very useful
    NOTE:
    I am not suppose to make use of the method replaceAll( ) to do the replacements
    Thanks and regards
    khurram

    I am getting these errors
    i am not able to understand why
    i looked into the java2 complete reference text
    ther is no method called isHexDigit( ) in it
    pleasae do help
    the errors are as follows
    [systpe@Agni ~]$ javac C1.java
    C1.java:9: cannot resolve symbol
    symbol : method isHexDigit (char)
    location: class java.lang.Character
    if(!Character.isHexDigit(ch))
    ^
    C1.java:11: cannot resolve symbol
    symbol : method digitValue (char,int)
    location: class java.lang.Character
    v |= Character.digitValue(ch, 16);
    ^
    C1.java:15: replace(char,char) in java.lang.String cannot be applied to (java.lang.String,j
    ava.lang.String)
    String subs = "ename".replace("m", String.valueOf(cv));
    ^
    3 errors
    Thanks & Regards
    khurram

  • When Hard-coded server name and data base name are replaced with variables , execute process task does not produce the result

    Hi All,
    I am trying to load shape file into a sql spatial table. A execution process task is used to run the ogr2ogr.exe program.
    This is how the process tab looks like .
    Executable : C:\gdal_ogr2ogr\bin\gdal\apps\ogr2ogr.exe
    Argument :  -f MSSQLSpatial   MSSQL:server=SQL-ABC-DEV;database=MYSIMPLE_Dev;Trusted_Connection=True;\\mypath\files\shares\Data\www.mypage.htm\my_sample_file.shp
    Success value : 1
    For above settings, package runs fine. The spatial table is created in SQL server db. However when hard-coded SQL server name and database name are replaced with global variables , the spatial table is not created in the database. Yet the package runs fine.
    It does not throw any errors. (I am using another variable for full file path. It is not causing any errors though)
    " -f MSSQLSpatial   MSSQL:server="+@[$Project::SQLServerName]+";database="+ @[$Project::DatabaseName] +";Trusted_Connection=True;"+ @[User::Filepath] + "\\my_sample_file.shp"
    Both variables are string type. Can anyone tell me what I am doing wrong here please?
    I am running this in VS 2012.
    Thanks for your help in advance..
    shamen

    There should be a single space just after True:
    before
    " -f MSSQLSpatial   MSSQL:server="+@[$Project::SQLServerName]+";database="+ @[$Project::DatabaseName] +";Trusted_Connection=True;"+ @[User::Filepath] + "\\my_sample_file.shp"
    after keeping the space
    " -f MSSQLSpatial   MSSQL:server="+@[$Project::SQLServerName]+";database="+ @[$Project::DatabaseName] +";Trusted_Connection=True; "+ @[User::Filepath] + "\\my_sample_file.shp"
    Thanks
    shamen

  • Link with a query string

    I am having problems when placing a link to an .asp page with
    a query string in it. Here is the link:
    http://www.destaco.com/new_products.asp?loc=<%=Request.QueryString("loc")%>&lang=<%=Reques t.QueryString("lang")%>
    The developer I'm working with says that this link is not
    working for him. Any ideas? I did try replacing the " with ' around
    loc and lang, but that didn't seem to work. Any insights would be
    greatly appreciated. Thanks.

    You can't put asp code like that within Flash. If you have
    those same
    variables in Flash you can do this:
    on (release) {
    //Goto Webpage Behavior
    getURL("
    http://www.destaco.com/new_products.asp?loc"+loc+"&lang="+lang+",
    "_parent");
    //End Behavior
    Do you have those variables in Flash? Or, are you trying to
    pull them from
    the asp page?
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "Jim Switzer" <[email protected]> wrote in
    message
    news:eaq712$q83$[email protected]..
    > I'm putting this link on a button. Is that what you were
    asking? Here's
    > the
    > code on the button:
    >
    > on (release) {
    > //Goto Webpage Behavior
    >
    > getURL("
    http://www.destaco.com/new_products.asp?loc=<%=Request.QueryString('loc
    >
    ')%>&lang=<%=Request.QueryString('lang')%>",
    "_parent");
    > //End Behavior
    > }
    >
    > Let me know if that helps clarify this, or if you need
    more info. Thanks.
    >

Maybe you are looking for