trim

How to prevent spaces form JSF h:inputText

依然范特西╮ 提交于 2019-12-17 16:55:17
问题 In my JSF 2.2 application, when I create JSF form, the problem is that I can put spaces in the beginning of <h:inputText> when I insert it from my form and it will return these spaces with my value that I inserted in it. So I should handle each value with mystring.tirm() to void the spaces. Can I use any something else to return this value without spaces? I know about converter and JavaScript, so can you give me another option to use? I don't want to use any converter and JavaScript. 回答1: I

Use of undefined constant STDIN - assumed 'STDIN' in C:\wamp\www\study\sayHello.php on line 5

拥有回忆 提交于 2019-12-17 16:29:19
问题 I want to Learn php & mySQL and I purchased a book (php&mySql: the missing manuals 2edition) I installed Wampserver2.4 on win8 64bit machine. Server Configuration Apache Version : 2.4.4 PHP Version : 5.4.12 in first lesson i got this error :( Notice: Use of undefined constant STDIN - assumed 'STDIN' in C:\wamp\www\study\sayHello.php on line 5 this is the php code on file "sayHello.php" <?php echo "Hello there. So I hear you're learning to be a PHP programmer!\n"; echo "Why don't you type in

Remove whitespaces inside a string in javascript

耗尽温柔 提交于 2019-12-17 06:31:22
问题 I've read this question about javascript trim, with a regex answer. Then I expect trim to remove the inner space between Hello and World. function myFunction() { alert("Hello World ".trim()); } EDITED Why I expected that!? Nonsense! Obviously trim doesn't remove inner spaces!, only leading and trailing ones, that's how trim works, then this was a very wrong question, my apologies. 回答1: For space-character removal use "hello world".replace(/\s/g, ""); for all white space use the suggestion by

How to remove trailing and leading whitespace for user-provided input in a batch file?

眉间皱痕 提交于 2019-12-17 04:31:22
问题 I know how to do this when the variable is pre-defined. However, when asking for the user to enter in some kind of input, how do I trim leading and trailing whitespace? This is what I have so far: @echo off set /p input=: echo. The input is %input% before ::trim left whitespace for /f "tokens=* delims= " %%a in ("%input%") do set input=%%a ::trim right whitespace (up to 100 spaces at the end) for /l %%a in (1,1,100) do if "!input:~-1!"==" " set input=!input:~0,-1! echo. The input is %input%

triming extension from filename in Excel

China☆狼群 提交于 2019-12-14 01:16:59
问题 I have this formula. This works great but fails when there are 5 characters including the dot. For example, abcdefgh.pdf =TRIM(LEFT(A1,LEN(A1)-4)) gives me abcdefgh xyz.xlsx =TRIM(LEFT(A2,LEN(A2)-4)) gives me xyz. Is there a formula that looks for the last dot and trims everything after the last dot? 回答1: Try this formula to get rid of the last dot and everything after =LEFT(A1,LOOKUP(2^15,FIND(".",A1,ROW(INDIRECT("1:"&LEN(A1)))))-1) If there's only ever one dot as per your examples then you

Why data is truncated when importing from XML to an Access database

感情迁移 提交于 2019-12-13 09:19:03
问题 When I import the XML into Access, One of the XML columns is trimmed in Access database. Is there any way to specify the data type for each column when importing into Access? I tried to change the column size but it allows 255 character only but my column in XML is more than 255. I want to copy an XML file to Access database and from Access database to SQL. Please let me know the method and i have to create two tables from one xml I have tried using directly importing from xml to sql. i got

Trim the tree at the specified depth. In Prolog

微笑、不失礼 提交于 2019-12-13 08:21:58
问题 Arguments: arbitrary binary tree; necessary depth; result tree. Result: ?- pred(s(f(b(m,k),a),t(a,g)),2,X). X = s(f,t) yes ?- pred(s(f(b(m,k),a),t(a,g)),3,X). X = s(f(b,a),t(a,g)) yes ?- Can someone help me with it? 回答1: Let's rearrange your examples: ?- pred( s( f(b(m,k),a), t(a,g)), 3, X). X = s(f(b,a),t(a,g)) yes ?- pred( s( f(b(m,k),a), t(a,g)), 2, X). X = s(f,t) yes ?- pred( s( f(b(m,k),a), t(a,g)), 1, X). X = s yes ?- pred( s( f(b(m,k),a), t(a,g)), 0, X). no Now it's clear what needs to

Php Contact Form - Optional Fields (trim)

我们两清 提交于 2019-12-13 06:19:28
问题 I have a php contact form I'm trying to edit to suit my needs. Currently, every field needs to be filled out in order for the form to work. What do I need to edit in order to make some fields optional? Below isn't the full script, but I have a feeling its the segment of the field most important for what I need to do. Thanks $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $date = $_POST['date']; $guests = $_POST['guests']; $subject = $_POST['subject']; $comments = $

Find duplicate text in a string and remove it

谁说胖子不能爱 提交于 2019-12-13 04:43:18
问题 I have this excel problem. I am trying to find matching text between 2 columns and then remove the matched text. Example Column 1: John Romeo Column 2: John Romeo 16 Smith Street Results: 16 Smith Street The Results column is the text that I want. 回答1: Here's a custom function called WORDDIF that may do what you want. To install the custom function in Windows ... Alt+F11 to open the VBA Editor From the VBA menu, select Insert -> Module To install the custom function in OS X ... Go to Tools ->

Regex to trim leading/trailng commas: ,aa,bb,cc,

假如想象 提交于 2019-12-13 04:13:52
问题 I'm trying to capture aa,bb,cc from the following strings: ,aa,bb,cc, aa,bb,cc, ,aa,bb,cc aa,bb,cc My plan was to: Match the start of line anchor, or the anchor followed by a comma Capture until the end of line anchor, or a comma followed by the end of line anchor The closest I've got is: (?:^,|^)(.*)(?:$|,$) , but that includes trailing commas in the capture group: ,aa,bb,cc, -> aa,bb,cc, aa,bb,cc, -> aa,bb,cc, ,aa,bb,cc -> aa,bb,cc aa,bb,cc -> aa,bb,cc Why isn't it working, and what's the