whitespace

Convert string to whitespace

I'm looking for av way to convert a string into whitespace; spaces, newlines and tabs, and the other way around. I found a Python script, but I have no idea how to do it using Javascript. I need it for a white-hacking contest. ...

AS3 TextField.textWidth ignore whitespace at end.

Hi I'm trying to calculate the textWidth, but it seems to ignore the white spaces at the end. The text "Hello" "Hello " returns the same text width. A string with " " returns 0. How do I calculate the width with the space? ...

Why does XmlReader skip every other element if there is no whitespace separator?

I'm seeing strange behavior when I try to parse XML using the LINQ XmlReader class. Test case below: it looks like whether I use (XElement)XNode.ReadFrom(xmlReader) or one of the Read() methods on XmlReader, it misses the second bar elements in the input XML. If any whitespace is added between the </bar> and <bar> then it will parse th...

How to add extra whitespace in PHP?

I was wondering how can I add extra whitespace in php is it something like \s please help thanks. Is there a tutorial that list these kind of things thanks. ...

how to remove whitespace while scanning text in java

I've implemented several different "scanners" in java, from the Scanner class to simply using String.split("\ss+") but when there are several whitespaces in a row like "the_quick____brown___fox" they all tokenize certain white spaces (Imagine the underscores are whitespaces). Any suggestions? ...

remove multiple whitespaces in php

I'm getting $row['message'] from my mysql db and I need to remove all whitespaces like \n \t and so on. $row['message'] = 'This is a Text \n and so on \t Text text.'; should be formated to: $row['message'] = 'This is a Text and so on Text text.'; I tried $ro = preg_replace('/\s\s+/', ' ',$row['message']); echo $ro; but ...

Managing line width in ColdFusion

If you work with ColdFusion, you've probably gotten used to either line-wrapping or horizontal scrolling. Infrequently, this isn't so bad, but when three out of four lines in an existing code base are wrapped, sometimes twice, it becomes a huge readability hindrance. A line such as... <cffunction name="v_multiple_item" access="public"...

Value of whitespace in html source code

I'm using a function to generate all output in php. Using that function I can control whether to display the code like this: <html><header></header><body><p>Hello World!</p></body></html> or like this <html> <header> </header> <body> <p>Hello World!</p> </body> </html> including the indentation and all. Is there a particular v...

Browser interpreting line breaks in code as spaces (HTML)

I have 6 images sized 50x50 that are supposed to fit in a 300px div (50 * 6 = 300). In my code I write them as follows: <img src="foo.png" /> <img src="foo.png" /> <img src="foo.png" /> <img src="foo.png" /> <img src="foo.png" /> <img src="foo.png" /> Note the line breaks in between the image tags. I write them that way for clarity. T...

Removing whitespace in Java string?

Hi guys, I'm writing a parser for some LISP files. I'm trying to get rid of leading whitespace in a string. The string contents are along the lines of: :FUNCTION (LAMBDA (DELTA PLASMA-IN-0) (IF (OR (>= #61=(+ ...

C++ Pointer in Function

Possible Duplicate: Whats your preferred pointer declaration style, and why? I know that technically all three ways below are valid, but is there any logical reason to do it one way or the other? I mean, lots of things in c++ are "technically valid" but that doesn't make them any less foolish. int* someFunction(int* input) {...

Whitespace Between Tags in HAML

Is there a way to specify "pretty-print"-like formatting around HTML tags? I want to be able to put whitespace between blocks of HTML, so this: <!-- container --> <div id='container'> </div> <!-- footer --> <div id="footer"> </div> <!-- analytics --> ... ...is converted to this: <!-- container --> <div id='container'> </div> <!-- ...

Removing white space inside quotes in XSLT

I'm trying to format a table from XML. Lets say I have this line in the XML <country>Dominican Republic</country> I would like to get my table to look like this <td class="country DominicanRepublic">Dominican Republic</td> I've tried this: <td class="country {country}"><xsl:value-of select="country"/></td> then this: <xsl:eleme...

Where can these be posted besides the Python Cookbook?

Whitespace Assembler #! /usr/bin/env python """Assembler.py Compiles a program from "Assembly" folder into "Program" folder. Can be executed directly by double-click or on the command line. Give name of *.WSA file without extension (example: stack_calc).""" ##############################################################################...

include a .tex file with spaces in the filename

I am including chapters in my latex file one by one by using the \include{} statement, up till now I've had no problem with that. But I've recently written a chapter which I've saved under a name including spaces...because you can. Now the include{} statement apparently doesn't like spaces, and prints just the filename in my document in...

One pass multiple whitespace replace to single whitespace and eliminate leading and trailing whitespaces

void RemoveSpace(char *String) { int i=0,y=0; int leading=0; for(i=0,y=0;String[i]!='\0';i++,y++) { String[y]=String[i]; // let us copy the current character. if(isspace(String[i])) // Is the current character a space? { if(isspace(String[i+1])||String[i+1]=='\0'||leading!=1) // l...

Prevent line break between two elements in CSS

For some basic layout work I'm doing, I'd like links that immediately follow a price to always be shown on the same line as the price. The price text is wrapped in a <span class="price"> tag while the link uses the buy-link class as in <a href="/buy" class="buy-link">Buy Now</a>. I'm looking for CSS that will automatically prevent line ...

XSLT: how to ignore unnecessary white space?

Hi, Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is John </tag> </doc> And the following XSLT sheet: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; <xsl:template match="/"> <xsl:for-each select="doc/tag"> <xsl:value-of select="."/> </...

Using preg_replace in php for whitespace between <br/> and <p> tags

I need to remove this string if found in my string: <p><br/> </p> Cant replace this: <p><br/>Test. </p> The whitespace expression I am using wasn't working for that, thank you for your help! ...

Rails - strip xml import from whitespace and line break

Hey folks, I am stuck with something quite simple but really annoying: I have an xml file with one node, where the content includes line breaks and whitspaces. Sadly I can't change the xml. <?xml version="1.0" encoding="utf-8" ?> <ProductFeed> ACME Ltd. Fooproduct Foo Root :: Bar Category I get to the nod...