Search Results

Search found 37183 results on 1488 pages for 'string conversion'.

Page 123/1488 | < Previous Page | 119 120 121 122 123 124 125 126 127 128 129 130  | Next Page >

  • Replacing characters with specified one

    - by mahesh
    Hello All, I have a string as follows - MFMFMF now i want to change this string to FMFMFM how to do this , help needed pls i had tried select replace(replace('mfmfmf','M','F'),'F','M') this gives me result - MMMMMM which i donot what i want the output to be FMFMFM Need your help D.Mahesh

    Read the article

  • Simplest way to match array of strings to search in perl?

    - by Ben Dauphinee
    What I want to do is check an array of strings against my search string and get the corresponding key so I can store it. Is there a magical way of doing this with Perl, or am I doomed to using a loop? If so, what is the most efficient way to do this? I'm relatively new to Perl (I've only written 2 other scripts), so I don't know a lot of the magic yet, just that Perl is magic =D Reference Array: (1 = 'Canon', 2 = 'HP', 3 = 'Sony') Search String: Sony's Cyber-shot DSC-S600 End Result: 3

    Read the article

  • Output on namespaced xpath in java

    - by user347928
    I have the following code and have had some trouble with a specific field and it's output. The namespace is connected but doesn't seem to be outputting on the required field. Any info on this would be great. import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import java.io.ByteArrayInputStream; import java.io.IOException; public class test { public static void main(String args[]) { String xmlStr = "<aws:UrlInfoResponse xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:Response xmlns:aws=\"http://awis.amazonaws.com/doc/2005-07-11\">\n" + " <aws:OperationRequest>\n" + " <aws:RequestId>blah</aws:RequestId>\n" + " </aws:OperationRequest>\n" + " <aws:UrlInfoResult>\n" + " <aws:Alexa>\n" + " <aws:TrafficData>\n" + " <aws:DataUrl type=\"canonical\">harvard.edu/</aws:DataUrl>\n" + " <aws:Rank>1635</aws:Rank>\n" + " </aws:TrafficData>\n" + " </aws:Alexa>\n" + " </aws:UrlInfoResult>\n" + " <aws:ResponseStatus xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:StatusCode>Success</aws:StatusCode>\n" + " </aws:ResponseStatus>\n" + " </aws:Response>\n" + "</aws:UrlInfoResponse>"; DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance(); xmlFact.setNamespaceAware(true); DocumentBuilder builder = null; try { builder = xmlFact.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Document doc = null; try { doc = builder.parse( new ByteArrayInputStream( xmlStr.getBytes())); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println(doc.getDocumentElement().getNamespaceURI()); System.out.println(xmlFact.isNamespaceAware()); String xpathStr = "//aws:OperationRequest"; XPathFactory xpathFact = XPathFactory.newInstance(); XPath xpath = xpathFact.newXPath(); String result = null; try { result = xpath.evaluate(xpathStr, doc); } catch (XPathExpressionException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } System.out.println("XPath result is \"" + result + "\""); } }

    Read the article

  • Missing backslahes in filename using C#

    - by CL4NCY
    Hi, I have a string literal as follows: string filename = @"C:\myfolder\myfile.jpg"; When I use File.Exists(filename) it works most of the time but sometimes I get an error saying the following file doesn't exist: C:myfoldermyfile.jpg Something seems to strip the backslashes out of the filename. This code is sometimes accessed via an ajax request. Does anyone know why/how this could be happening?

    Read the article

  • which to use OLEDB or ODBC for SYbase

    - by nitinkhanna
    Hi, I am not able to figure out which drivers should I use. Even I don't know what I have. When I am trying to make the connection string through the .udl file it only shows SYbase ASE OleDB Provider while in install folder I can see in driver list Syabse Ase ODBC driver but in connection string it is unable to pick up the driver, here I used Driver = (Sybase ASE ODBC Driver) What should I go for? Thanks

    Read the article

  • Help with regex in javascript.

    - by Bipul
    Whatever string is given I have to see if there is exactly one space after and before =, If it is more than one space in either side I have to reduce that to one and if there is none, I have to insert one. How should I do that ? String can contain anything. Thanks

    Read the article

  • C# Regex: Capture everything up to...

    - by JamesBrownIsDead
    I want to capture everything up to (not including) a # sign in a string. The # character may or may not be present (if it's not present, the whole string should be captured). What would the RegEx and C# code for this by? I've tried: ([^#]+)(?:#) but it doesn't seem to work.

    Read the article

  • lua split into words

    - by anon
    I have a string in lua. It's a bunch of [a-zA-Z0-9]+ separated by a number (1 or more) spaces. How do I take the string and split it into a table of strings? Thanks!

    Read the article

  • DateTime Format Strings?

    - by Phil
    I have the date format string dd-mm-yy. Please can you tell me how to add hours and minutes to the string (i.e 13-03-2010.21.03) .... DateTime.Today.ToString("dd-mm-yy") ?

    Read the article

  • Get the last '/' or '\\' character in Python

    - by wowus
    If I have a string that looks like either ./A/B/c.d OR .\A\B\c.d How do I get just the "./A/B/" part? The direction of the slashes can be the same as they are passed. This problem kinda boils down to: How do I get the last of a specific character in a string? Basically, I want the path of a file without the file part of it.

    Read the article

  • Output on namespaced xpath

    - by user347928
    Hi there, I have the following code and have had some trouble with a specific field and it's output. The namespace is connected but doesn't seem to be outputting on the required field. Any info on this would be great. import org.w3c.dom.Document; import org.xml.sax.SAXException; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathExpressionException; import java.io.ByteArrayInputStream; import java.io.IOException; public class test { public static void main(String args[]) { String xmlStr = "<aws:UrlInfoResponse xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:Response xmlns:aws=\"http://awis.amazonaws.com/doc/2005-07-11\">\n" + " <aws:OperationRequest>\n" + " <aws:RequestId>blah</aws:RequestId>\n" + " </aws:OperationRequest>\n" + " <aws:UrlInfoResult>\n" + " <aws:Alexa>\n" + " <aws:TrafficData>\n" + " <aws:DataUrl type=\"canonical\">harvard.edu/</aws:DataUrl>\n" + " <aws:Rank>1635</aws:Rank>\n" + " </aws:TrafficData>\n" + " </aws:Alexa>\n" + " </aws:UrlInfoResult>\n" + " <aws:ResponseStatus xmlns:aws=\"http://alexa.amazonaws.com/doc/2005-10-05/\">\n" + " <aws:StatusCode>Success</aws:StatusCode>\n" + " </aws:ResponseStatus>\n" + " </aws:Response>\n" + "</aws:UrlInfoResponse>"; DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance(); xmlFact.setNamespaceAware(true); DocumentBuilder builder = null; try { builder = xmlFact.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); } Document doc = null; try { doc = builder.parse( new ByteArrayInputStream( xmlStr.getBytes())); } catch (SAXException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } System.out.println(doc.getDocumentElement().getNamespaceURI()); System.out.println(xmlFact.isNamespaceAware()); String xpathStr = "//aws:OperationRequest"; XPathFactory xpathFact = XPathFactory.newInstance(); XPath xpath = xpathFact.newXPath(); String result = null; try { result = xpath.evaluate(xpathStr, doc); } catch (XPathExpressionException e) { e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } System.out.println("XPath result is \"" + result + "\""); } } Thanks Tony

    Read the article

  • Java: JPQL search -similar- strings

    - by bguiz
    What methods are there to get JPQL to match similar strings? By similar I mean: Contains: search string is found within the string of the matches entity Case-insensitive Small mispellings: e.g. "arow" matches "arrow" I suspect the first two will be easy, however, I would appreciate help with the last one Thank you

    Read the article

  • How to combine query strings in PHP

    - by incrediman
    Given a url, and a query string, how can I get the url resulting from the combination of the query string with the url? I'm looking for functionality similar to .htaccess's qsa. I realize this would be fairly trivial to implement completely by hand, however are there built-in functions that deal with query strings which could either simplify or completely solve this? Example input/result sets: Url="http://www.example.com/index.php/page?a=1" QS ="?b=2" Result="http://www.example.com/index.php/page?a=1&b=2" - Url="page.php" QS ="?b=2" Result="page.php?b=2"

    Read the article

  • Are there any way to apply regexp in java ignoring letter case?

    - by Roman
    Simple example: we have string "Some sample string Of Text". And I want to filter out all stop words (i.e. "some" and "of") but I don't want to change letter case of other words which should be retained. If letter case was unimportant I would do this: str.toLowerCase().replaceAll ("a|the|of|some|any", ""); Is there an "ignore case" solution with regular expressions in java?

    Read the article

  • ruby enclose selected whole words in brackets

    - by astropanic
    @string = "Sometimes some stupid people say some stupid words" @string.enclose_in_brackets("some") # => "Sometimes {some} stupid people say {some} stupid words" How should the method enclose_in_brackets look ? Please keep in mind, I want only enclose whole words, (I don't want "{Some}times {some} stupid....", the "sometimes" word should be left unchanged

    Read the article

  • Subscript text in pdf C#

    - by daft
    How do I insert a subscript charachter in a string in C#? I have nor problems appending a superscript 2 in the same string using char.ConvertFromUtf32(178);, but I struggle with finding a similar solution for the subscripted text. Actually, I'm struggling with finding ANY solution at all to this rather embarrassing issue. :)

    Read the article

  • How do I use multiple precisions in printf()?

    - by Tommy
    Looking at the information under the heading "Precision can be omitted or be any of:". The example: printf("%.*s", 3, "abcdef"); works, outputting:abc (truncating the rest of the string.) Now, I would like to have a string with multiple parameters formatted (truncated): printf("%.*s, %.*s", 3, 3, "abcdef", "xyz123"); but the program crashes. What is the correct syntax? Thank You.

    Read the article

< Previous Page | 119 120 121 122 123 124 125 126 127 128 129 130  | Next Page >