Search Results

Search found 37934 results on 1518 pages for 'string split'.

Page 7/1518 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Compare two String with MySQL

    - by Scorpi0
    Hi, I wan't to compare two strings in a SQL request so I can retrieve the best match, the aim is to propose to an operator the best zip code possible. For example, in France, we have Integer Zip code, so I made an easy request : SELECT * FROM myTable ORDER BY abs(zip_code - 75000) This request returns first the data closest of Paris. Unfortunatelly, United Kingdom have zip code like AB421RS, so my request can't do it. I see in SQL Server a function 'Difference' : http://www.java2s.com/Code/SQLServer/String-Functions/DIFFERENCEworkoutwhenonestringsoundssimilartoanotherstring.htm But I use MySQL.. Is there anyone who have a good idea to do the trick in one simple request ? PS : the Levenshtein Distance will not do it, as I really wan't to compare string like if they were number. ABCDEF have to be closer to AWXYZ than to ZBCDEF.

    Read the article

  • How to format output using MATLAB's num2str

    - by Doresoom
    I'm trying to ouput an array of numbers as a string in MATLAB. I know this is easily done using num2str, but I wanted commas followed by a space to separate the numbers, not tabs. The array elements will at most have resolution to the tenths place, but most of them will be integers. Is there a way to format output so that unnecessary trailing zeros are left off? Here's what I've managed to put together: data=[2,3,5.5,4]; datastring=num2str(data,'%.1f, '); datastring=['[',datastring(1:end-1),']'] which gives the output: [2.0, 3.0, 5.5, 4.0] rather than: [2, 3, 5.5, 4] Any suggestions? EDIT: I just realized that I can use strrep to fix this by calling datastring=strrep(datastring,'.0','') but that seems even more kludgey than what I've been doing.

    Read the article

  • How Do I Pull Info from String

    - by Russ Bradberry
    I am trying to pull dynamics from a load that I run using bash. I have gotten to a point where I get the string I want, now from this I want to pull certain information that can vary. The string that gets returned is as follows: Records: 2910 Deleted: 0 Skipped: 0 Warnings: 0 Each of the number can and will vary in length, but the overall structure will remain the same. What I want to do is be able to get these numbers and load them into some bash variables ie: RECORDS=?? DELETED=?? SKIPPED=?? WARNING=?? In regex I would do it like this: Records: (\d*?) Deleted: (\d*?) Skipped (\d*?) Warnings (\d*?) and use the 4 groups in my variables.

    Read the article

  • Javascript string syntax to write SQL

    - by sebastien leblanc
    I am writing an SQL query as a Javascript string like that: SQLdetail = 'SELECT [Avis SAP], Avis.[Ordre SAP], [Date Appel], [Heur Appel], Client_List![Code Client], [Numero Passerelle], [Designation Appel], Ordre![Metier], Ordre!Repercussion, Ordre!Objet, Ordre![Profil Panne], Ordre!Cause, Ordre![Sommaire Correctif], Ordre![Statut]' SQLdetail += ' FROM (Avis' SQLdetail += ' LEFT JOIN Client_List ON Avis.[Numero Client] = Client_List.[Numero Client])' SQLdetail += ' LEFT JOIN Ordre ON Avis.[Ordre SAP] = Ordre.[Ordre SAP] WHERE Avis.[Date Appel] BETWEEN #' & DateOne & '# AND #' & DateTwo & '#;' alert('SQLdetail:' + SQLdetail) and the last SQLdetail += somehow returns "0". Am I missing something in the syntax that just turns the whole string to a 0?

    Read the article

  • [Java] Cut <br/>-Tags from String end

    - by Robert M.
    Hello everybody, I am currently developing a Web-Application using Java EE where I'm using a Rich-Javascript-Editor (http://www.primefaces.org/showcase/ui/editor.jsf). As the user can easily add too many linebreaks that will be convertet to linebreak-tags, I need to remove all these Tags from the end of a String. Is there an elegant way of using Regex to accomplish this? An example String would be: "This is a test <b>bold</b><br/><br/>" Where obviously the last two tags have to be removed. Thank you in advance for any help Best Regards, Robert

    Read the article

  • How to split up a long list using \n

    - by pypy
    Here is a long string that I convert to a list so I can manipulate it, and then join it back together. I am having some trouble being able to have an iterator go through the list and when the iterator reach, let us say every 5th object, it should insert a '\n' right there. Here is an example: string = "Hello my name is Josh I like pizza and python I need this string to be really really long" string = string.split() # do the magic here string = ' '.join(string) print(string) Output: Hello my name is Josh I like pizza and python I need this string to be really really long Any idea how i can achieve this? I tried using: for words in string: if words % 5 == 0: string.append('\n') but it doesn't work. What am I missing?

    Read the article

  • Transforming a string to a valid PDO_MYSQL DSN

    - by Alix Axel
    What is the most concise way to transform a string in the following format: mysql:[/[/]][user[:pass]@]host[:port]/db[/] Into a usuable PDO connection/instance (using the PDO_MYSQL DSN), some possible examples: $conn = new PDO('mysql:host=host;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user'); $conn = new PDO('mysql:host=host;port=3307;dbname=db', 'user', 'pass'); I've been trying some regular expressions (preg_[match|split|replace]) but they either don't work or are too complex, my gut tells me this is not the way to go but nothing else comes to my mind. Any suggestions?

    Read the article

  • String Format for DateTime in C#

    - by SAMIR BHOGAYTA
    String Format for DateTime [C#] This example shows how to format DateTime using String.Format method. All formatting can be done also using DateTime.ToString method. Custom DateTime Formatting There are following custom format specifiers y (year), M (month), d (day), h (hour 12), H (hour 24), m (minute), s (second), f (second fraction), F (second fraction, trailing zeroes are trimmed), t (P.M or A.M) and z (time zone). Following examples demonstrate how are the format specifiers rewritten to the output. [C#] // create date time 2008-03-09 16:05:07.123 DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123); String.Format("{0:y yy yyy yyyy}", dt); // "8 08 008 2008" year String.Format("{0:M MM MMM MMMM}", dt); // "3 03 Mar March" month String.Format("{0:d dd ddd dddd}", dt); // "9 09 Sun Sunday" day String.Format("{0:h hh H HH}", dt); // "4 04 16 16" hour 12/24 String.Format("{0:m mm}", dt); // "5 05" minute String.Format("{0:s ss}", dt); // "7 07" second String.Format("{0:f ff fff ffff}", dt); // "1 12 123 1230" sec.fraction String.Format("{0:F FF FFF FFFF}", dt); // "1 12 123 123" without zeroes String.Format("{0:t tt}", dt); // "P PM" A.M. or P.M. String.Format("{0:z zz zzz}", dt); // "-6 -06 -06:00" time zone You can use also date separator / (slash) and time sepatator : (colon). These characters will be rewritten to characters defined in the current DateTimeForma­tInfo.DateSepa­rator and DateTimeForma­tInfo.TimeSepa­rator. [C#] // date separator in german culture is "." (so "/" changes to ".") String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9/3/2008 16:05:07" - english (en-US) String.Format("{0:d/M/yyyy HH:mm:ss}", dt); // "9.3.2008 16:05:07" - german (de-DE) Here are some examples of custom date and time formatting: [C#] // month/day numbers without/with leading zeroes String.Format("{0:M/d/yyyy}", dt); // "3/9/2008" String.Format("{0:MM/dd/yyyy}", dt); // "03/09/2008" // day/month names String.Format("{0:ddd, MMM d, yyyy}", dt); // "Sun, Mar 9, 2008" String.Format("{0:dddd, MMMM d, yyyy}", dt); // "Sunday, March 9, 2008" // two/four digit year String.Format("{0:MM/dd/yy}", dt); // "03/09/08" String.Format("{0:MM/dd/yyyy}", dt); // "03/09/2008" Standard DateTime Formatting In DateTimeForma­tInfo there are defined standard patterns for the current culture. For example property ShortTimePattern is string that contains value h:mm tt for en-US culture and value HH:mm for de-DE culture. Following table shows patterns defined in DateTimeForma­tInfo and their values for en-US culture. First column contains format specifiers for the String.Format method. Specifier DateTimeFormatInfo property Pattern value (for en-US culture) t ShortTimePattern h:mm tt d ShortDatePattern M/d/yyyy T LongTimePattern h:mm:ss tt D LongDatePattern dddd, MMMM dd, yyyy f (combination of D and t) dddd, MMMM dd, yyyy h:mm tt F FullDateTimePattern dddd, MMMM dd, yyyy h:mm:ss tt g (combination of d and t) M/d/yyyy h:mm tt G (combination of d and T) M/d/yyyy h:mm:ss tt m, M MonthDayPattern MMMM dd y, Y YearMonthPattern MMMM, yyyy r, R RFC1123Pattern ddd, dd MMM yyyy HH':'mm':'ss 'GMT' (*) s SortableDateTi­mePattern yyyy'-'MM'-'dd'T'HH':'mm':'ss (*) u UniversalSorta­bleDateTimePat­tern yyyy'-'MM'-'dd HH':'mm':'ss'Z' (*) (*) = culture independent Following examples show usage of standard format specifiers in String.Format method and the resulting output. [C#] String.Format("{0:t}", dt); // "4:05 PM" ShortTime String.Format("{0:d}", dt); // "3/9/2008" ShortDate String.Format("{0:T}", dt); // "4:05:07 PM" LongTime String.Format("{0:D}", dt); // "Sunday, March 09, 2008" LongDate String.Format("{0:f}", dt); // "Sunday, March 09, 2008 4:05 PM" LongDate+ShortTime String.Format("{0:F}", dt); // "Sunday, March 09, 2008 4:05:07 PM" FullDateTime String.Format("{0:g}", dt); // "3/9/2008 4:05 PM" ShortDate+ShortTime String.Format("{0:G}", dt); // "3/9/2008 4:05:07 PM" ShortDate+LongTime String.Format("{0:m}", dt); // "March 09" MonthDay String.Format("{0:y}", dt); // "March, 2008" YearMonth String.Format("{0:r}", dt); // "Sun, 09 Mar 2008 16:05:07 GMT" RFC1123 String.Format("{0:s}", dt); // "2008-03-09T16:05:07" SortableDateTime String.Format("{0:u}", dt); // "2008-03-09 16:05:07Z" UniversalSortableDateTime

    Read the article

  • Marshalling the value of a char* ANSI string DLL API parameter into a C# string

    - by Brian Biales
    For those who do not mix .NET C# code with legacy DLL's that use char* pointers on a regular basis, the process to convert the strings one way or the other is non-obvious. This is not a comprehensive article on the topic at all, but rather an example of something that took me some time to go find, maybe it will save someone else the time. I am utilizing a third party too that uses a call back function to inform my application of its progress.  This callback includes a pointer that under some circumstances is a pointer to an ANSI character string.  I just need to marshal it into a C# string variable.  Seems pretty simple, yes?  Well, it is, (as are most things, once you know how to do them). The parameter of my callback function is of type IntPtr, which implies it is an integer representation of a pointer.  If I know the pointer is pointing to a simple ANSI string, here is a simple static method to copy it to a C# string: private static string GetStringFromCharStar(IntPtr ptr) {     return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ptr); } The System.Runtime.InteropServices is where to look any time you are mixing legacy unmanaged code with your .NET application.

    Read the article

  • search and display string from group of string php

    - by zahir hussain
    hi i want to know how to search and display string from group of string like google display the word which we search... the following example from google search word is google books result Search and preview millions of books from libraries and publishers worldwide using Google Book Search. Discover a new favorite or unearth an old classic. i would like to do this type of one... thanks and advance

    Read the article

  • Split DNS clarification

    - by RidableCthulu
    I need some clarification if I understood this correctly. I've been reading about Active Directory and naming my domain, and the reason Microsoft didn't suggest using external public domain was DNS Split. If I understood correctly (and please correct me if I did) in this case I have two Domain Name Servers, both doing the same job, but one of them is internal (in my company i.e.) and the other is a public one. Did I misunderstand this and if I did could somebody explain this to me? I hope this question is not too broad for this site! Cheers.

    Read the article

  • Remote support via VPN without split tunnel

    - by Robe Eleckers
    my title might not be very clear, but I'll explain my setup in more detail now. We have several customers (companies) that need to be remotely supported. At these customers we have servers running with our software that needs to be serviced. These servers are (almost) never connected to the internet. For this we have multiple PC's running VPN clients. These PC's run a VNC server so our service engineers can login from their home laptop remotely to these PC's and connect from there to our customer via the VPN connection on the PC. The problem is however that several customers do not allow split tunneling. That means that when we connect via VPN to such a customer the VNC connection drops. Our current workaround is using a Citrix VM which we control via XenCenter console, but it's quite slow. Are there common solutions to handle this?

    Read the article

  • How to split file on Windows 2003 using MS supported tool

    - by Rune
    Hi, Is it possible to split a large file into smaller files on Windows 2003 using a tool provided/supported/sanctioned by Microsoft? I see that there are a lot of freeware tools (various zip tools) for this task, but I need to move files off of a production server, thus would like to avoid tools I don't know if I can trust. I would much prefer some tool included in the Windows Server 2003 Resource Kit Tools or something along those lines. Does such a tool exist? Thank you.

    Read the article

  • How to find string in a string

    - by owca
    I somehow need to find the longest string in other string, so if string1 will be "Alibaba" and string2 will be "ba" , the longest string will be "baba". I have the lengths of strings, but what next ? char* fun(char* a, char& b) { int length1=0; int length2=0; int longer; int shorter; char end='\0'; while(a[i] != tmp) { i++; length1++; } int i=0; while(b[i] != tmp) { i++; length++; } if(dlug1 > dlug2){ longer = length1; shorter = length2; } else{ longer = length2; shorter = length1; } //logics here } int main() { char name1[] = "Alibaba"; char name2[] = "ba"; char &oname = *name2; cout << fun(name1, oname) << endl; system("PAUSE"); return 0; }

    Read the article

  • string maniupulations, oops, how do I replace parts of a string

    - by Joe Gibson
    I am very new to python. Could someone explain how I can manipulate a string like this? This function receives three inputs: complete_fmla: has a string with digits and symbols but has no hyphens ('-') nor spaces. partial_fmla: has a combination of hyphens and possibly some digits or symbols, where the digits and symbols that are in it (other than hyphens) are in the same position as in the complete_formula. symbol: one character The output that should be returned is: If the symbol is not in the complete formula, or if the symbol is already in the partial formula, the function should return the same formula as the input partial_formula. If the symbol is in the complete_formula and not in the partial formula, the function should return the partial_formula with the symbol substituting the hyphens in the positions where the symbol is, in all the occurrences of symbol in the complete_formula. For example: generate_next_fmla (‘abcdeeaa’, ‘- - - - - - - - ’, ‘d’) should return ‘- - - d - - - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d - - - - ’, ‘e’) should return ‘- - - d e e - -’ generate_next_fmla (‘abcdeeaa’, ‘- - - d e e - - ’, ‘a’) should return ‘a - - d e e a a’ Basically, I'm working with the definition: def generate_next_fmla (complete_fmla, partial_fmla, symbol): Do I turn them into lists? and then append? Also, should I find out the index number for the symbol in the complete_fmla so that I know where to append it in the string with hyphens??

    Read the article

  • Finding multiple values in a string Jquery / Javascript

    - by user257503
    I have a three strings of categories "SharePoint,Azure,IT"; "BizTalk,Finance"; "SharePoint,Finance"; I need to find a way to check if a string contains for example "SharePoint" and "IT", or "BizTalk" and "Finance". The tests are individual strings themselces. How would i loop through all the category strings (1 - 3) and only return the ones which have ALL instances of the souce. i have tried the following function doesExist(source, filterArray) { var substr = filterArray.split(" "); jQuery.each(substr, function() { var filterTest = this; if(source.indexOf(filterTest) != -1 ) { alert("true"); return true; }else { alert("false"); return false; } }); } with little success...the code above checks one at a time rather than both so the results returned are incorrect. Any help would be great. Thanks Chris UPDATE: here is a link to a work in progress version..http://www.invisiblewebdesign.co.uk/temp/filter/#

    Read the article

  • Recursive String Function (Java)

    - by Jake Brooks
    Hi, I am trying to design a function that essentially does as follows: String s = "BLAH"; store the following to an array: blah lah bah blh bla bl ba bh ah al So basically what I did there was subtract each letter from it one at a time. Then subtract a combination of two letters at a time, until there's 2 characters remaining. Store each of these generations in an array. Hopefully this makes sense, Jake

    Read the article

  • Problems removing a " from a string

    - by Graeme
    Hi, I have a string that ends with a " (quotation mark) that I want to get rid of. However, because XCode usually requires you to enter the text you wish to remove using stringByReplacingOccurrencesOfString in @"texttoremove" format, you can't use the quotation marks in the space as it thinks you are closing the text. Any ideas on how I can do it? Thanks.

    Read the article

  • Filter string in C

    - by Paul Tarjan
    How can I filter a string in c? I want to remove anything that isn't [a-z0-9_]. int main(int argc, char ** argv) { char* name = argv[1]; // remove anything that isn't [a-z0-9_] printf("%s", name); }

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >