fast string methods for: count, find, startswith, endswith, split.
version 0.3.2
fast lua string operations
License: MIT License
Could a license please be attached with this so we can safely use it in a commercial project (or know not to) please?
Can you please push the new version stringy-0.3-1
to the LuaRocks repository?
The latest version available is still 0.2-1
: https://rocks.moonscript.org/modules/luarocks/stringy
Version 0.2-1
has some serious bugs, like startswith
always returning true
.
Could you help me? I want to use your stringy lib, but i don’t understand something. Here is a v string:
["header",["Content-Disposition","form-data; name="fileToUpload"; filename="Furi.docx"","Content-Disposition: form-data; name="fileToUpload"; filename="Furi.docx""]]
I want to strip filename, but for this expression:
stringy.split (v, "filename")[2]
i got
orm-data; name="
but i thought i need to get this:
="Furi.docx"","Content-Disposition: form-data; name="fileToUpload"; filename="Furi.docx""]]
What did/thought i wrong?
Thanks.
local stringy = require "stringy"
-- Doesn't work
print(stringy.startswith("hello", "")) -- Returns true!
I didn't test endswith
but it might have the same bug.
Tested with stringy 0.4-1
Why not define lstrip and rstrip as in python, and strip some customized charactors.
The latest package on luarocks is 0.4-1, released about three years ago. There are newer changes which would be useful to people (me, in particular). Would it be possible to update the module to include the latest changes?
https://luarocks.org/modules/brentp/stringy
This was referenced in another issue, where control of the stringy luarocks module was given to @brentp. #3
gcc -O2 -fPIC -I/usr/local/include -c stringy/stringy.c -o stringy/stringy.o -Istringy/
stringy/stringy.c: 在函数‘join’中:
stringy/stringy.c:182:5: 错误:只允许在 C99 模式下使用‘for’循环初始化声明
for (int i = 2; i <= top; ++i) {
^
stringy/stringy.c:182:5: 附注:使用 -std=c99 或 -std=gnu99 来编译您的代码
Error: Failed installing dependency: https://luarocks.org/stringy-0.7-0.src.rock - Build error: Failed compiling object stringy/stringy.o
I'm seeing this on luajit on El Capitan:
|| lua: error loading module 'stringy' from file '/Users/jdonaldson/env/lib/lua/5.1/stringy.so':
|| dlopen(/Users/jdonaldson/env/lib/lua/5.1/stringy.so, 6): Symbol not found: _fastsearch
|| Referenced from: /Users/jdonaldson/env/lib/lua/5.1/stringy.so
|| Expected in: flat namespace
|| in /Users/jdonaldson/env/lib/lua/5.1/stringy.so
|| stack traceback:
|| [C]: at 0x010006c150
|| [C]: in function 'require'
out.lua|54 info| in main chunk
|| [C]: at 0x0100001580
|| Error: Command failed with error 1
It works if I downgrade to 0.2-1 That was suggested by these related articles :
Kong/kong#213
Kong/kong#1736
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.