whitespace

Remove Whitespace From XML Nodes

How can I remove whitespace on every instance of a particular node which I specify in C#? For example let's say that I have the following XML document: <XML_Doc> <Record_1> <Name>Bob</Name> <ID_Number>12345</ID_Number> <Sample> </Sample> </Record_1> <Record_2> <Name>John</Name> <ID_Number>54321</ID_...

Remove extra white space from inside a C string?

I have read a few lines of text into an array of C-strings. The lines have an arbitrary number of tab or space-delimited columns, and I am trying to figure out how to remove all the extra whitespace between them. The end goal is to use strtok to break up the columns. This is a good example of the columns: Cartwright Wendy 93 Willi...

How can I get the first non-white space character of a line using php

I have a line that typically starts with a few spaces as the lines are in columns and use a monospace font to make things line up. I want to check if the first non-white space character (or even just the first thing that isn't a space) and see if that is a number. What is the least server intensive way of doing this? ...

What makes a language readable or not readable?

I heard people say they can understand their python code a year later but not their XYZ code. Why? I dont know what is good about python syntax or what is bad about another. I like C# but i have a feeling VB.NET code is easier to read. I am doing language design so what do you find makes code/syntax/language readable or not readable? ...

Comparing two files

I am comparing to files by reading it into filestream and comparing byte by byte..now how can i skip whitespaces while comparing?I am using C#.net ...

Compiler Design

Is newline and whitespaces the same in compiler design? what if you write a macro to replace newlines by whitespaces, is this correct or would it cause some form of problems? ...

How do I insert a lot of whitespace in Perl?

I need to buff out a line of text with a varying but large number of whitespace. I can figure out a janky way of doing a loop and adding whitespace to $foo, then splicing that into the text, but it is not an elegant solution. ...

How to reformat space delimited lines of text into separate <div> tags in C language?

Guys, I need to be able to (in C language) loop over a few lines of text where each line has some text in it where words are delimited by a variable number of white spaces. How can I detect the spaces and split each line into some kind of array so that I can put each word in a separate word tag in each line? Any advice would be much ap...

JavaScript Whitespace Syntax Error

Why does this cause a syntax error for the return statement: var FOO = (function($) { return { init: function() { } } })(jQuery); Whereas this doesn't: var FOO = (function($) { return { init: function() { } } })(jQuery); Why is there a difference? ...

How to call WSDL2JAVA from ant with whitespaces in my path

HI guys! I try to call Axis2 WSDL2JAVA in my ant file to create a WSDL client. But it's broken because I have whitespaces in my path (I'm on Windows...). This is my ant <property name="wsdl.file" location="C:\path with whitespaces\project\subdir\my.wsdl"/> ... <target name="generate.client" depends="Clean.Client"> <java classname=...

Preserving whitespaces in a string as a command line argument

I'm facing a small problem here, I want to pass a string containing whitespaces , to another program such that the whole string is treated as a command line argument. In short I want to execute a command of the following structure through a bash shell script: command_name -a arg1 -b arg2 -c "arg with whitespaces here" But no matter how...

How to Take whitespace in Input in C

I wanted to take character array from console and it also include white spaces, the only method i know in C is scanf, but it miss stop taking input once it hit with white space. What i should do? Here is what i am doing. char address[100]; scanf("%s", address); ...

Tab Vs Space preferences in Vim

Vim is very accommodating when it comes to tab Vs. space preferences. As I understand it, the tabstop setting indicates the width of a tab character. The shiftwidth setting specifies how many columns to increment/decrement when using the << and >> commands, whereas the softtabstop setting influences the amount of whitespace to be inserte...

Setting Vim whitespace preferences by filetype

At my work, I am required to follow the house style for indentation, which goes as follows: 2 spaces when coding html and ruby tabs when coding javascript, with tabwidth=4 recommended What is the best way to specify different whitespace preferences per filetype? ...

jquery ending string at space

Hi, I have a form to 'create a tag'. Using the jQuery code below. $("#createtag").submit(function() { //same as above, but for form submit instead of button click var newtag = $('#newtag').attr('value'); var type_id = $('#type_id').attr('value'); var company_id = $('#company_id').attr('value'); $('#crea...

Make IE respect your whitespace with dynmically changed content

If I have the following line in html: <span></span> wtf and then I run the jQuery statement: $("span").html("test"); It ends up looking like "testwtf" instead of "test wtf". Is there anything I can do about this without changing the html? ...

Why does git care about trailing whitespace in my files?

What business is it of whatever VCS I'm using to worry about what I put in my files? I don't get what the point here is. Is git version control or syntax checker? ...

Escaping whitespace within nested shell/perl scripts

I'm trying to run a perl script from within a bash script (I'll change this design later on, but for now, bear with me). The bash script receives the argument that it will run. The argument to the script is as follows: test.sh "myscript.pl -g \"Some Example\" -n 1 -p 45" within the bash script, I simple run the argument that was passe...

In xsl, is there a way to next a normalize-space call inside a sum?

I have an XML file that has a number of nodes, each of which contains a <current-fine> node. I need to sum these values but unfortunately they contain white-space so I end up getting NaN as the total. Is there a way of achieving the following: <xsl:value-of select="sum(normalize-space(node/sub-node/current-fine))"/> Many thanks ...

How many non-printing characters are in common use?

When writing interpreters for PDF, HTML and other documents we need to deal with a variety of white-space characters and additional non-printing characters. The ANSI ones are well defined, but how many others are likely to be found in practice? A typical example is the cluster in ISO10646 (I think): &ensp; &#8194;     en spac...