我有一个文本框收集我的JS代码中的用户输入.我想过滤垃圾输入,就像只包含空格的字符串一样.
在C#中,我将使用以下代码:
if (inputString.Trim() == "") Console.WriteLine("white junk");
else Console.WriteLine("Valid input");
Run Code Online (Sandbox Code Playgroud)
你有任何推荐,如何在JavaScript中做同样的事情?
我想使用XSD.exe工具(来自VS2008 SDK)从KML2.2 xml架构生成C#帮助文件.使用KML2.1,该工具工作正常.但是,KML2.2架构包含指向其他模式的导入标记,导致XSD.exe 崩溃.
这是我收到的错误消息:
C:\Program Files\Microsoft Visual Studio 2008 SDK\VisualStudioIntegration\Sample
s\Sdm> xsd.exe d:\temp\kml22.xsd /c /l:CS /n:Google.Kml22 /o:D:\temp\
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: The 'http://www.w3.org/2005/Atom:author' element is
not declared. Line 311, position 12.
Schema validation warning: The 'http://www.w3.org/2005/Atom:link' element is not
declared. Line 312, position 12.
Schema validation warning: The 'urn:oasis:names:tc:ciq:xsdschema:xAL:2.0:Address
Details' element is not declared. Line 314, position …Run Code Online (Sandbox Code Playgroud)