Search Results

Search found 36172 results on 1447 pages for 'unicode string'.

Page 50/1447 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • ruby - find and replace in a string for commonly used street suffix

    - by go minimal
    The post office actually publishes a list of commonly used street suffixes in addresses: http://www.usps.com/ncsc/lookups/abbr_suffix.txt I want to take this list and make a ruby function that takes a string, takes the last word ("183 main strt".split[' '].last) and if it matches any of the commonly used street suffixes ("strt"), replace it with the official Postal Service Standard Suffix ("st"). Is there a better way to approach this than a massive str.sub.sub.sub.sub.sub?

    Read the article

  • undefined method `bytes' for for String in Ruby

    - by artsince
    I am working with ruby 1.8.6 (2007-03-13 patchlevel 0) [x86_64-linux] and I get undefined method `bytes' for #<String:0x2a95ec2268> (NoMethodError) even though my code works on ruby 1.8.7. patchlevel 249 I saw somewhere that you need to add require "jcode" for a similar method not defined error with each_byte. I tried adding that but it still does not work. Any suggestions are very appreciated.

    Read the article

  • Documentation String Stub, Python

    - by Andres Orozco
    Well i'm learning Python cuz' i think is an awesome and powerful language like C++, perl or C# but is really really easy at same time. I'm using JetBrains' Pycharm and when i define a function it ask me to add a "Documentation String Stub" when i click yes it adds somethin like this: """ """ so the full code of the function is something like this: def otherFunction(h, w): """ """ hello = h world = w full_word = h + ' ' + w return full_word I would like to know what these (""" """) symbols means, Thanks. Ps.Data: Sorry for my bad english :D

    Read the article

  • parse my proprietary string format

    - by microsumol
    How can we get the numbers 7 and 4 and 5 from the following string: MODULE potmtpMAIN main <info: "Enterprise Optimizer 7.4 for COR Technology 5.5 -- Advanced Solver Edition", url:"http://EO.riverlogic.com", url_menu:"EO Online...", app_id:"EOAS",app_name:"Enterprise Optimizer AS", app_major:7, app_minor:4,app_micro:5,app_copyright:"\251 1996-2010 River Logic Inc.\r\nAll Rights Reserved."> The search must be based on app_major: app_minor: and app_micro Thank You in advance

    Read the article

  • Java - Incrementing through IP addresses in String format

    - by Matt
    I'm new to java and i'm trying to find a way of incrementing through an user input IP address range. For example from 192.168.0.1 to 192.168.0.255. However the way my application works at the moment is the take the from and to ip addresses as a String. Is there a way I can increment through all the ip addresses the user input from and to? Hope this makes sense and please dont flame me, I have looked for an answer!

    Read the article

  • How can I put quotes in a string?

    - by riad
    I need to write a string literal to a text file, but the C# compiler finds errors when I use quote characters in it. My current code: writeText.WriteLine("<?xml version="1.0" encoding="utf-8"?>"); I need the output for the text file to be: <?xml version="1.0" encoding="utf-8"?> How can I put quote characters in strings in C#?

    Read the article

  • a Problem to pass a string between 2 view controller (iPhone)

    - by Toma
    my problem is quite simple, but as a beginner, I'm lost :D I have to view controller : view one call view 2 like this : self.FacebookTypeRequest =@"favoris"; FaceBookViewController *viewcontrol = [[FaceBookViewController alloc]initWithNibName:@"FaceBookViewController" bundle:[NSBundle mainBundle]]; viewcontrol.title = @"FaceBook"; [self.navigationController pushViewController:viewcontrol animated:YES]; [viewcontrol release]; How can i send my string facebookTypeRequest to my view controller 2 ? Thanks for your help

    Read the article

  • A program where user enters a string and the program counts the instances of the letters

    - by user1865183
    This is the first C++ program I have ever written and I'm having trouble understanding the order in which operands must be put in. This is for a class, but it looks like I'm not supposed to use the homework tag. Sorry if I'm doing this wrong. This is my input // Get DNA string string st; cout << "Enter the DNA sequence to be analysed: "; cin >> st; This seems to work ok, but I thought I would include it incase this is what I'm doing wrong. This is what I have so far to check that the input is exclusively C,T,A, or G. It runs through the program and simply prints "Please enter a valid sequnce1, please enter a valid sequence2, ... ect. I'm sure I'm doing something very stupid, I just can't figure it out. // Check that the sequence is all C, T, A, G while (i <= st.size()){ if (st[i] != 'c' && st[i] != 'C' && st[i] != 'g' && st[i] != 'G' && st[i] != 't' && st[i] != 'T' && st[i] != 'a' && st[i] != 'A'); cout << "Please enter a valid sequence" << i++; else if (st[i] == c,C,G,t,T,a,A) i++; The second half of my program is to count the number of Cs and Gs in the sequence for (i < st.size() ; i++ ;); for (loop <= st.size() ; loop++;) if (st[loop] == 'c') { count_c++; } else if (st[loop] == C) { count_c++; } else if (st[loop] == g) { count_g++; } else if (st[loop] == G); { count_g++; } cout << "Number of instances of C = " << count_c; cout << "Number of instances of G = " << count_g; It seems like it's not looping, it will count 1 of one of the letters. How do I make it loop? I can't seem to put in endl; anywhere without getting an error back, although I know I'll need it somewhere. Any help or tips to point me in the right direction would be greatly appreciated - I've been working on this code for two days (this is embarrassing to admit).

    Read the article

  • What does plus sign does here in string?

    - by Thanga
    I would like to know, what is the difference between two statements, these may be simple String ss="myname"; char[] charArray = ss.toCharArray(); for ( char character : charArray ) { System.out.println( +character );//Statements are here what does plus refers here: System.out.println( character ); //Statements are here: } I got the output for the code no errors but little doubt on how it works? What happens here? If you would down vote let me know the reason please , Thanks in advance

    Read the article

  • C# Extension Method for String Data Type

    - by Jimbo
    My web application deals with strings that need to be converted to numbers alot - users often put commas, currency symbols etc. in these fields so what I want to do is create a string extension method that cleans the field up and converts it to a decimal. For example: decimal myNumber = "$1,250.85".ToDecimal(); Can anyone help with this? Thanks!

    Read the article

  • Remove trailing letters at the end of string

    - by wang
    I have some strings like below: ffffffffcfdeee^dddcdeffffffffdddcecffffc^cbcb^cb`cdaba`eeeeeefeba[NNZZcccYccaccBBBBBBBBBBBBBBBBBBBBBB eedeedffcc^bb^bccccbadddba^cc^e`eeedddda`deca_^^\```a```^b^`I^aa^bb^`_b\a^b```Y_\`b^`aba`cM[SS\ZY^BBB Each string MAY (or may not) end with a stretch of trailing "B" of varied length. I'm just wondering if we can simply use bash code to remove the "B" stretch? thx

    Read the article

  • Python List length as a string

    - by mvid
    Is there a preferred (not ugly) way of outputting a list length as a string? Currently I am nesting function calls like so: print "Length: %s" % str(len(self.listOfThings)) This seems like a hack solution, is there a more graceful way of achieving the same result?

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >